mirror of
https://github.com/atom/atom.git
synced 2026-02-14 16:45:14 -05:00
Only add newline when insert row exceeds last row
Previously if the line before a trailing newline was duplicated an extra newline would inserted with the duplicated line.
This commit is contained in:
@@ -421,7 +421,7 @@ class EditSession
|
||||
bufferRange = new Range([cursorPosition.row], [cursorPosition.row + 1])
|
||||
|
||||
insertPosition = new Point(bufferRange.end.row)
|
||||
if insertPosition.row >= @buffer.getLastRow()
|
||||
if insertPosition.row > @buffer.getLastRow()
|
||||
@unfoldCurrentRow() if cursorRowFolded
|
||||
@buffer.append("\n#{@getTextInBufferRange(bufferRange)}")
|
||||
@foldCurrentRow() if cursorRowFolded
|
||||
|
||||
Reference in New Issue
Block a user