mirror of
https://github.com/atom/atom.git
synced 2026-02-12 23:55:10 -05:00
Leave the undo stack intact when aborting empty transactions
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user