From 1b8a8cf93912ed2c61e72c7df6a79ef5d928756d Mon Sep 17 00:00:00 2001 From: Corey Johnson & Nathan Sobo Date: Fri, 3 May 2013 17:21:50 -0600 Subject: [PATCH] Make UndoManager.clear not cancel the transaction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/app/undo-manager.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/undo-manager.coffee b/src/app/undo-manager.coffee index baea1fa5a..c8673b224 100644 --- a/src/app/undo-manager.coffee +++ b/src/app/undo-manager.coffee @@ -11,7 +11,7 @@ class UndoManager @clear() clear: -> - @currentTransaction = null + @currentTransaction = [] if @currentTransaction? @undoHistory = [] @redoHistory = []