From ac215e11b459d7337611e169ab3004ebcbbb9e68 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 3 Feb 2015 12:19:42 -0700 Subject: [PATCH] Fix velocity scrolling upward MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There’s no need to check that the mouseWheelScreenRow is on screen before preserving the corresponding line. --- src/text-editor-presenter.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/text-editor-presenter.coffee b/src/text-editor-presenter.coffee index e56258f86..6655280c2 100644 --- a/src/text-editor-presenter.coffee +++ b/src/text-editor-presenter.coffee @@ -160,10 +160,9 @@ class TextEditorPresenter @buildLineState(row, line) row++ - if @mouseWheelScreenRow? and not startRow <= @mouseWheelScreenRow < endRow + if @mouseWheelScreenRow? preservedLine = @model.tokenizedLineForScreenRow(@mouseWheelScreenRow) visibleLineIds[preservedLine.id] = true - @updateLineState(@mouseWheelScreenRow, preservedLine) for id, line of @state.content.lines unless visibleLineIds.hasOwnProperty(id) @@ -260,7 +259,7 @@ class TextEditorPresenter @state.gutter.lineNumbers[id] = {screenRow, bufferRow, softWrapped, top, decorationClasses, foldable} visibleLineNumberIds[id] = true - if @mouseWheelScreenRow? and not startRow <= @mouseWheelScreenRow < endRow + if @mouseWheelScreenRow? screenRow = @mouseWheelScreenRow top = screenRow * @lineHeight bufferRow = @model.bufferRowForScreenRow(screenRow)