Leave the undo stack intact when aborting empty transactions

This commit is contained in:
Kevin Sawicki & Nathan Sobo
2013-01-04 13:01:23 -07:00
parent 29f371b347
commit da095cdfe9
2 changed files with 15 additions and 0 deletions

View File

@@ -40,12 +40,18 @@ class UndoManager
commit: ->
@undoHistory.push(@currentTransaction) if @currentTransaction?.length
empty = @currentTransaction.length is 0
@undoHistory.push(@currentTransaction) unless empty
@currentTransaction = null
not empty
abort: ->
@commit()
@undo()
@redoHistory.pop()
if @commit()
@undo()
@redoHistory.pop()
undo: (editSession) ->
try