mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
Back to green specs 🤘
This commit is contained in:
parent
907dc661ec
commit
087dc3b4fd
@ -893,7 +893,7 @@ describe "TextEditorPresenter", ->
|
||||
expect(getState(presenter).content.scrollTop).toBe 13
|
||||
|
||||
it "scrolls down automatically when the model is changed", ->
|
||||
presenter = buildPresenter(scrollTop: 0, lineHeight: 10, explicitHeight: 10)
|
||||
presenter = buildPresenter(scrollTop: 0, lineHeight: 10, explicitHeight: 20)
|
||||
|
||||
editor.setText("")
|
||||
editor.insertNewline()
|
||||
|
@ -20,10 +20,11 @@ class LinesYardstick
|
||||
targetTop = pixelPosition.top
|
||||
targetLeft = pixelPosition.left
|
||||
defaultCharWidth = @model.getDefaultCharWidth()
|
||||
row = @lineTopIndex.rowForPixelPosition(targetTop, 'floor')
|
||||
row = @lineTopIndex.rowForPixelPosition(targetTop)
|
||||
targetLeft = 0 if targetTop < 0
|
||||
targetLeft = Infinity if row > @model.getLastScreenRow()
|
||||
row = Math.min(row, @model.getLastScreenRow())
|
||||
row = Math.max(0, row)
|
||||
|
||||
line = @model.tokenizedLineForScreenRow(row)
|
||||
lineNode = @lineNodesProvider.lineNodeForLineIdAndScreenRow(line?.id, row)
|
||||
|
Loading…
Reference in New Issue
Block a user