Don't cancel a snippet if the cursor moves due to a buffer change

This commit is contained in:
Nathan Sobo
2013-02-02 18:01:18 -07:00
parent bd96db781e
commit 60304b76b1

View File

@@ -22,12 +22,10 @@ class SnippetExpansion
@editSession.normalizeTabsInBufferRange(newRange)
@indentSubsequentLines(startPosition.row, snippet) if snippet.lineCount > 1
cursorMoved: ({oldBufferPosition, newBufferPosition}) ->
return if @settingTabStop
cursorMoved: ({oldBufferPosition, newBufferPosition, bufferChanged}) ->
return if @settingTabStop or bufferChanged
oldTabStops = @tabStopsForBufferPosition(oldBufferPosition)
newTabStops = @tabStopsForBufferPosition(newBufferPosition)
@destroy() unless _.intersect(oldTabStops, newTabStops).length
placeTabStopAnchorRanges: (startPosition, tabStopRanges) ->