🐛 fix selection of penultimate row to retrieve line ending

This commit is contained in:
jamsinclair
2016-10-12 10:14:46 +13:00
parent 6517421ded
commit 443425733d

View File

@@ -1132,7 +1132,7 @@ class TextEditor extends Model
# Delete lines spanned by selection and insert them on the preceding buffer row
lines = @buffer.getTextInRange(linesRange)
lines += @buffer.lineEndingForRow(linesRange.end.row - 1) unless lines[lines.length - 1] is '\n'
lines += @buffer.lineEndingForRow(linesRange.end.row - 2) unless lines[lines.length - 1] is '\n'
@buffer.delete(linesRange)
@buffer.insert([precedingRow, 0], lines)