mirror of
https://github.com/atom/atom.git
synced 2026-02-12 07:35:14 -05:00
Wrap all line movements in transact
This commit is contained in:
committed by
Luke Pommersheim
parent
e889e85e2a
commit
6d2c4b61b4
@@ -823,14 +823,14 @@ class TextEditor extends Model
|
||||
moveLineUp: ->
|
||||
newSelectionBufferRanges = []
|
||||
selections = @getSelectedBufferRanges()
|
||||
selections.sort (a, b) ->
|
||||
a.compare(b)
|
||||
for selection in selections
|
||||
return if selection.start.row is 0
|
||||
lastRow = @buffer.getLastRow()
|
||||
return if selection.isEmpty() and selection.start.row is lastRow and @buffer.getLastLine() is ''
|
||||
selections.sort (a, b) -> a.compare(b)
|
||||
|
||||
@transact =>
|
||||
for selection in selections
|
||||
continue if selection.start.row is 0
|
||||
lastRow = @buffer.getLastRow()
|
||||
continue if selection.isEmpty() and selection.start.row is lastRow and @buffer.getLastLine() is ''
|
||||
|
||||
@transact =>
|
||||
foldedRows = []
|
||||
rows = [selection.start.row..selection.end.row]
|
||||
if selection.start.row isnt selection.end.row and selection.end.column is 0
|
||||
@@ -875,7 +875,7 @@ class TextEditor extends Model
|
||||
|
||||
newSelectionBufferRanges.push(selection.translate([-insertDelta]))
|
||||
|
||||
@setSelectedBufferRanges(newSelectionBufferRanges, preserveFolds: true, autoscroll: true)
|
||||
@setSelectedBufferRanges(newSelectionBufferRanges, preserveFolds: true, autoscroll: true)
|
||||
|
||||
# Move lines intersecting the most recent selection or muiltiple selections down by one row in screen
|
||||
# coordinates.
|
||||
|
||||
Reference in New Issue
Block a user