mirror of
https://github.com/atom/atom.git
synced 2026-02-10 22:55:09 -05:00
Redoing a snippet expansion restores tab stops to the *current* edit session
This commit is contained in:
@@ -55,6 +55,7 @@ class SnippetExpansion
|
||||
anchorRange.destroy() for anchorRange in @tabStopAnchorRanges
|
||||
@editSession.snippetExpansion = null
|
||||
|
||||
restoreTabStops: ->
|
||||
restore: (@editSession) ->
|
||||
@editSession.snippetExpansion = this
|
||||
@tabStopAnchorRanges = @tabStopAnchorRanges.map (anchorRange) =>
|
||||
@editSession.addAnchorRange(anchorRange.getBufferRange())
|
||||
|
||||
@@ -32,10 +32,8 @@ module.exports =
|
||||
snippetExpansion = new SnippetExpansion(snippet, editSession)
|
||||
editSession.snippetExpansion = snippetExpansion
|
||||
editSession.pushOperation
|
||||
undo: -> editSession.snippetExpansion.destroy()
|
||||
redo: ->
|
||||
editSession.snippetExpansion = snippetExpansion
|
||||
snippetExpansion.restoreTabStops()
|
||||
undo: -> snippetExpansion.destroy()
|
||||
redo: (editSession) -> snippetExpansion.restore(editSession)
|
||||
else
|
||||
e.abortKeyBinding()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user