mirror of
https://github.com/atom/atom.git
synced 2026-02-07 13:14:55 -05:00
Add EditSession.transact and friends
`EditSession.transact` adds more semantics on top of `UndoManager`'s version pertaining to restoring selections on undo/redo of the transaction.
This commit is contained in:
@@ -224,14 +224,11 @@ class Buffer
|
||||
else
|
||||
operation.do()
|
||||
|
||||
transact: (fn) ->
|
||||
@undoManager.transact(fn)
|
||||
|
||||
undo: (editSession) ->
|
||||
@undoManager.undo(editSession)
|
||||
|
||||
redo: (editSession) ->
|
||||
@undoManager.redo(editSession)
|
||||
transact: (fn) -> @undoManager.transact(fn)
|
||||
undo: (editSession) -> @undoManager.undo(editSession)
|
||||
redo: (editSession) -> @undoManager.redo(editSession)
|
||||
commit: -> @undoManager.commit()
|
||||
abort: -> @undoManager.abort()
|
||||
|
||||
save: ->
|
||||
@saveAs(@getPath()) if @isModified()
|
||||
|
||||
Reference in New Issue
Block a user