mirror of
https://github.com/atom/atom.git
synced 2026-02-12 07:35:14 -05:00
Append line ending if it isn’t present
This commit is contained in:
committed by
Luke Pommersheim
parent
b14f3d8d92
commit
2fc2c074be
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user