From b14f3d8d9211403db06c2088463f64080e9dfe6d Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 11 Aug 2015 15:31:00 -0600 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20move=20any=20lines=20if=20some?= =?UTF-8?q?=20lines=20can=E2=80=99t=20move?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/text-editor.coffee | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 080f85df7..0c1cc282d 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -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