Skip to content

Commit

Permalink
Take care to not modify deltas in place when composing in undo-manager,
Browse files Browse the repository at this point in the history
fixes slab#296
  • Loading branch information
thomsbg committed Jun 2, 2015
1 parent 545eedc commit d32cc16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/undo-manager.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class UndoManager
timestamp = new Date().getTime()
if @lastRecorded + @options.delay > timestamp and @stack.undo.length > 0
change = @stack.undo.pop()
undoDelta = undoDelta.compose(change.undo)
changeDelta = change.redo.compose(changeDelta)
undoDelta = new Delta().compose(undoDelta).compose(change.undo)
changeDelta = new Delta().compose(change.redo).compose(changeDelta)
else
@lastRecorded = timestamp
@stack.undo.push({
Expand Down

0 comments on commit d32cc16

Please sign in to comment.