Compute insertDelta more simply

This commit is contained in:
Nathan Sobo
2015-08-11 15:20:22 -06:00
committed by Luke Pommersheim
parent b8d02dedde
commit de500ce41a

View File

@@ -839,10 +839,7 @@ class TextEditor extends Model
# Move line around the fold that is directly above the selection
precedingScreenRow = @screenRowForBufferRow(selection.start.row) - 1
precedingBufferRow = @bufferRowForScreenRow(precedingScreenRow)
if fold = @largestFoldContainingBufferRow(precedingBufferRow)
insertDelta = fold.getBufferRange().getRowCount()
else
insertDelta = 1
insertDelta = selection.start.row - precedingBufferRow
for row in rows
if fold = @displayBuffer.largestFoldStartingAtBufferRow(row)