mirror of
https://github.com/atom/atom.git
synced 2026-01-22 13:28:01 -05:00
Don’t attempt to preserve mouseWheelScreenRow if it’s deleted
Fixes #5527
This commit is contained in:
@@ -839,6 +839,11 @@ describe "TextEditorPresenter", ->
|
||||
expect(presenter.state.content.lines[oldLine3.id]).toBeUndefined()
|
||||
expect(presenter.state.content.lines[newLine3.id]).toBeDefined()
|
||||
|
||||
it "does not attempt to preserve lines corresponding to ::mouseWheelScreenRow if they have been deleted", ->
|
||||
presenter = buildPresenter(explicitHeight: 25, scrollTop: 0, lineHeight: 10, lineOverdrawMargin: 1, stoppedScrollingDelay: 200)
|
||||
presenter.setMouseWheelScreenRow(10)
|
||||
editor.setText('')
|
||||
|
||||
describe "[lineId]", -> # line state objects
|
||||
it "includes the .endOfLineInvisibles if the editor.showInvisibles config option is true", ->
|
||||
editor.setText("hello\nworld\r\n")
|
||||
|
||||
@@ -228,8 +228,8 @@ class TextEditorPresenter
|
||||
row++
|
||||
|
||||
if @mouseWheelScreenRow?
|
||||
preservedLine = @model.tokenizedLineForScreenRow(@mouseWheelScreenRow)
|
||||
visibleLineIds[preservedLine.id] = true
|
||||
if preservedLine = @model.tokenizedLineForScreenRow(@mouseWheelScreenRow)
|
||||
visibleLineIds[preservedLine.id] = true
|
||||
|
||||
for id, line of @state.content.lines
|
||||
unless visibleLineIds.hasOwnProperty(id)
|
||||
|
||||
Reference in New Issue
Block a user