Reassign selection range immediately when moving lines up

This commit is contained in:
Nathan Sobo
2015-08-11 15:34:40 -06:00
committed by Luke Pommersheim
parent 7d98fc141f
commit 5d1e7469a1

View File

@@ -821,7 +821,6 @@ class TextEditor extends Model
# Move lines intersection the most recent selection or multiple selections up by one row in screen
# coordinates.
moveLineUp: ->
newSelectionBufferRanges = []
selections = @getSelectionsOrderedByBufferPosition()
if selections[0].getBufferRange().start.row is 0
@@ -872,9 +871,7 @@ class TextEditor extends Model
for foldedRow in foldedRows when 0 <= foldedRow <= @getLastBufferRow()
@foldBufferRow(foldedRow)
newSelectionBufferRanges.push(selectionRange.translate([-insertDelta]))
@setSelectedBufferRanges(newSelectionBufferRanges, preserveFolds: true, autoscroll: true)
selection.setBufferRange(selectionRange.translate([-insertDelta, 0]))
# Move lines intersecting the most recent selection or muiltiple selections down by one row in screen
# coordinates.