From 4d44016eb1b9511b7f6524e9d3c3900a9c700ea5 Mon Sep 17 00:00:00 2001 From: abe33 Date: Mon, 12 Oct 2015 19:40:23 +0200 Subject: [PATCH] :art: Remove unnecessary branching --- src/text-editor.coffee | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index e246f76a9..9988bc203 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -888,13 +888,8 @@ class TextEditor extends Model # could be multiple lines in the buffer. But at the same time, if the # next buffer row is wrapped, one line in the buffer can represent many # screen rows. - [nextBufferRowScreenStart, nextBufferRowScreenEnd] = @displayBuffer.rowMap.screenRowRangeForBufferRow(linesRange.end.row) - if nextBufferRowScreenEnd - nextBufferRowScreenStart > 1 - followingScreenRow = nextBufferRowScreenEnd - followingBufferRow = @bufferRowForScreenRow(followingScreenRow) - else - followingScreenRow = @screenRowForBufferRow(linesRange.end.row) + 1 - followingBufferRow = @bufferRowForScreenRow(followingScreenRow) + followingScreenRow = @displayBuffer.lastScreenRowForBufferRow(linesRange.end.row) + 1 + followingBufferRow = @bufferRowForScreenRow(followingScreenRow) insertDelta = followingBufferRow - linesRange.end.row # Any folds in the text that is moved will need to be re-created.