mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Only fold valid buffer rows
This commit is contained in:
@@ -705,7 +705,9 @@ class Editor extends Model
|
||||
|
||||
@buffer.insert(insertPosition, lines)
|
||||
|
||||
@foldBufferRow(foldedRow) for foldedRow in foldedRows
|
||||
# Restore folds that existed before the lines were moved
|
||||
for foldedRow in foldedRows when foldedRow <= @getLastBufferRow()
|
||||
@foldBufferRow(foldedRow)
|
||||
|
||||
@setSelectedBufferRange(selection.translate([insertDelta]), preserveFolds: true)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user