Don’t move any lines if some lines can’t move

This commit is contained in:
Nathan Sobo
2015-08-11 15:31:00 -06:00
committed by Luke Pommersheim
parent de500ce41a
commit b14f3d8d92

View File

@@ -825,12 +825,14 @@ class TextEditor extends Model
selections = @getSelectedBufferRanges()
selections.sort (a, b) -> a.compare(b)
if selections[0].start.row is 0
return
if selections[selections.length - 1].start.row is @getLastBufferRow() and @buffer.getLastLine() is ''
return
@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 ''
foldedRows = []
rows = [selection.start.row..selection.end.row]
if selection.start.row isnt selection.end.row and selection.end.column is 0