mirror of
https://github.com/atom/atom.git
synced 2026-02-14 00:25:08 -05:00
Don't move trailing newline for multiline selections
This commit is contained in:
@@ -342,7 +342,10 @@ class EditSession
|
||||
|
||||
@transact =>
|
||||
foldedRows = []
|
||||
for row in [selection.start.row..selection.end.row]
|
||||
rows = [selection.start.row..selection.end.row]
|
||||
if selection.start.row isnt selection.end.row and selection.end.column is 0
|
||||
rows.pop() unless @isFoldedAtScreenRow(@screenPositionForBufferPosition(selection.end).row)
|
||||
for row in rows
|
||||
screenRow = @screenPositionForBufferPosition([row]).row
|
||||
if @isFoldedAtScreenRow(screenRow)
|
||||
bufferRange = @bufferRangeForScreenRange([[screenRow], [screenRow + 1]])
|
||||
@@ -374,7 +377,10 @@ class EditSession
|
||||
|
||||
@transact =>
|
||||
foldedRows = []
|
||||
for row in [selection.end.row..selection.start.row]
|
||||
rows = [selection.end.row..selection.start.row]
|
||||
if selection.start.row isnt selection.end.row and selection.end.column is 0
|
||||
rows.shift() unless @isFoldedAtScreenRow(@screenPositionForBufferPosition(selection.end).row)
|
||||
for row in rows
|
||||
screenRow = @screenPositionForBufferPosition([row]).row
|
||||
if @isFoldedAtScreenRow(screenRow)
|
||||
bufferRange = @bufferRangeForScreenRange([[screenRow], [screenRow + 1]])
|
||||
|
||||
Reference in New Issue
Block a user