mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
Force a sync render when measuring if we don’t have a DOM node for a row
This commit is contained in:
parent
9f6fbacddd
commit
6669703677
@ -4567,6 +4567,13 @@ describe('TextEditorComponent', function () {
|
||||
})
|
||||
})
|
||||
|
||||
describe('::pixelPositionForScreenPosition()', () => {
|
||||
it('returns the correct horizontal position, even if it is on a row that has not yet been rendered (regression)', () => {
|
||||
editor.setTextInBufferRange([[5, 0], [6, 0]], 'hello world\n')
|
||||
expect(wrapperNode.pixelPositionForScreenPosition([5, Infinity]).left).toBeGreaterThan(0)
|
||||
})
|
||||
})
|
||||
|
||||
describe('middle mouse paste on Linux', function () {
|
||||
let originalPlatform
|
||||
|
||||
|
@ -440,6 +440,8 @@ class TextEditorComponent
|
||||
|
||||
unless @presenter.isRowVisible(screenPosition.row)
|
||||
@presenter.setScreenRowsToMeasure([screenPosition.row])
|
||||
|
||||
unless @linesComponent.lineNodeForLineIdAndScreenRow(@presenter.lineIdForScreenRow(screenPosition.row), screenPosition.row)?
|
||||
@updateSyncPreMeasurement()
|
||||
|
||||
pixelPosition = @linesYardstick.pixelPositionForScreenPosition(screenPosition)
|
||||
|
@ -1377,3 +1377,6 @@ class TextEditorPresenter
|
||||
|
||||
isRowVisible: (row) ->
|
||||
@startRow <= row < @endRow
|
||||
|
||||
lineIdForScreenRow: (screenRow) ->
|
||||
@model.tokenizedLineForScreenRow(screenRow)?.id
|
||||
|
Loading…
Reference in New Issue
Block a user