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:
Antonio Scandurra
2015-11-19 16:32:38 -08:00
parent cad7406085
commit ff08642d3b

View File

@@ -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())