From 6d2c4b61b4b42afcf8d501c38087f0781a22918b Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 11 Aug 2015 15:11:18 -0600 Subject: [PATCH] Wrap all line movements in transact --- src/text-editor.coffee | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 3ca335188..2fe1aa7f9 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -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.