Wrap all line movements in transact

This commit is contained in:
Nathan Sobo
2015-08-11 15:11:18 -06:00
committed by Luke Pommersheim
parent e889e85e2a
commit 6d2c4b61b4

View File

@@ -823,14 +823,14 @@ class TextEditor extends Model
moveLineUp: ->
newSelectionBufferRanges = []
selections = @getSelectedBufferRanges()
selections.sort (a, b) ->
a.compare(b)
for selection in selections
return if selection.start.row is 0
lastRow = @buffer.getLastRow()
return if selection.isEmpty() and selection.start.row is lastRow and @buffer.getLastLine() is ''
selections.sort (a, b) -> a.compare(b)
@transact =>
for selection in selections
continue if selection.start.row is 0
lastRow = @buffer.getLastRow()
continue if selection.isEmpty() and selection.start.row is lastRow and @buffer.getLastLine() is ''
@transact =>
foldedRows = []
rows = [selection.start.row..selection.end.row]
if selection.start.row isnt selection.end.row and selection.end.column is 0
@@ -875,7 +875,7 @@ class TextEditor extends Model
newSelectionBufferRanges.push(selection.translate([-insertDelta]))
@setSelectedBufferRanges(newSelectionBufferRanges, preserveFolds: true, autoscroll: true)
@setSelectedBufferRanges(newSelectionBufferRanges, preserveFolds: true, autoscroll: true)
# Move lines intersecting the most recent selection or muiltiple selections down by one row in screen
# coordinates.