mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Fix velocity scrolling upward
There’s no need to check that the mouseWheelScreenRow is on screen before preserving the corresponding line.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user