Skip to content

Commit

Permalink
fix: flush any pending changes before undo/redo
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed Nov 27, 2024
1 parent 51930de commit 81783f4
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/lib/components/modes/textmode/TextMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -487,11 +487,8 @@
return false
}
// first undo any pending changes
const added = addHistoryItem()
if (added) {
handleUndo()
}
// first flush any pending changes
flush()
const item = history.undo()
debug('undo', item)
Expand All @@ -516,11 +513,8 @@
return false
}
// first undo any pending changes
const added = addHistoryItem()
if (added) {
handleUndo()
}
// first flush any pending changes
flush()
const item = history.redo()
debug('redo', item)
Expand Down

0 comments on commit 81783f4

Please sign in to comment.