mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Return early in FakeLinesYardstick for unrendered rows
This allows us to have a more consistent behavior with the real LinesYardstick.
This commit is contained in:
@@ -7,6 +7,7 @@ class FakeLinesYardstick
|
||||
|
||||
prepareScreenRowsForMeasurement: ->
|
||||
@presenter.getPreMeasurementState()
|
||||
@screenRows = new Set(@presenter.getScreenRows())
|
||||
|
||||
getScopedCharacterWidth: (scopeNames, char) ->
|
||||
@getScopedCharacterWidths(scopeNames)[char]
|
||||
@@ -34,6 +35,8 @@ class FakeLinesYardstick
|
||||
left = 0
|
||||
column = 0
|
||||
|
||||
return {top, left: 0} unless @screenRows.has(screenPosition.row)
|
||||
|
||||
iterator = @model.tokenizedLineForScreenRow(targetRow).getTokenIterator()
|
||||
while iterator.next()
|
||||
characterWidths = @getScopedCharacterWidths(iterator.getScopes())
|
||||
|
||||
Reference in New Issue
Block a user