Make UndoManager.clear not cancel the transaction

If an exception is thrown while running an operation, we clear the
undo manager and re-throw it. But if we were in a transaction, we will
commit it in a `finally` block. If the transaction is set to null,
committing the transaction will then throw an exception which hides
the original exception… we don't want that. Now clear just empties the
current transaction out.
This commit is contained in:
Corey Johnson & Nathan Sobo
2013-05-03 17:21:50 -06:00
parent 9147e86d96
commit 1b8a8cf939

View File

@@ -11,7 +11,7 @@ class UndoManager
@clear()
clear: ->
@currentTransaction = null
@currentTransaction = [] if @currentTransaction?
@undoHistory = []
@redoHistory = []