Skip to content

Commit

Permalink
fix undo/redo
Browse files Browse the repository at this point in the history
  • Loading branch information
sprocketc committed Feb 29, 2024
1 parent 87e1651 commit b2fbe39
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/renderer/history/handlers.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@
([db]
(undo db 1))
([db n]
(if (and (pos? n) (undos? db))
(recur (move db (previous-position db)) (dec n))
(if (and (pos? n) (undos? (history db)))
(recur (move db (previous-position (history db))) (dec n))
db)))

(defn redo
([db]
(redo db 1))
([db n]
(if (and (pos? n) (redos? db))
(recur (move db (next-position db)) (dec n))
(if (and (pos? n) (redos? (history db)))
(recur (move db (next-position (history db))) (dec n))
db)))

(defn accumulate
Expand Down

0 comments on commit b2fbe39

Please sign in to comment.