mirror of
https://github.com/atom/atom.git
synced 2026-02-17 10:01:25 -05:00
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:
@@ -11,7 +11,7 @@ class UndoManager
|
||||
@clear()
|
||||
|
||||
clear: ->
|
||||
@currentTransaction = null
|
||||
@currentTransaction = [] if @currentTransaction?
|
||||
@undoHistory = []
|
||||
@redoHistory = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user