From 2fc2c074bef7ed014320eadb034d3abae553975e Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 11 Aug 2015 15:31:13 -0600 Subject: [PATCH] =?UTF-8?q?Append=20line=20ending=20if=20it=20isn=E2=80=99?= =?UTF-8?q?t=20present?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/text-editor.coffee | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 0c1cc282d..745f5c23e 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -856,8 +856,7 @@ class TextEditor extends Model insertPosition = Point.fromObject([startRow - insertDelta]) endPosition = Point.min([endRow + 1], @buffer.getEndPosition()) lines = @buffer.getTextInRange([[startRow], endPosition]) - if endPosition.row is lastRow and endPosition.column > 0 and not @buffer.lineEndingForRow(endPosition.row) - lines = "#{lines}\n" + lines += @buffer.lineEndingForRow(endPosition.row - 1) unless lines[lines.length - 1] is '\n' @buffer.deleteRows(startRow, endRow)