mirror of
https://github.com/atom/atom.git
synced 2026-01-26 07:19:06 -05:00
💚 Fix LinesYardstick specs
This commit is contained in:
@@ -57,7 +57,10 @@ describe "LinesYardstick", ->
|
||||
textNodes
|
||||
|
||||
editor.setLineHeightInPixels(14)
|
||||
linesYardstick = new LinesYardstick(editor, mockPresenter, mockLineNodesProvider, new LineTopIndex(), atom.grammars)
|
||||
lineTopIndex = new LineTopIndex()
|
||||
lineTopIndex.setDefaultLineHeight(editor.getLineHeightInPixels())
|
||||
lineTopIndex.setMaxRow(editor.getScreenLineCount())
|
||||
linesYardstick = new LinesYardstick(editor, mockPresenter, mockLineNodesProvider, lineTopIndex, atom.grammars)
|
||||
|
||||
afterEach ->
|
||||
lineNode.remove() for lineNode in createdLineNodes
|
||||
|
||||
@@ -25,6 +25,7 @@ class LinesYardstick
|
||||
row = @lineTopIndex.rowForTopPixelPosition(targetTop, 'floor')
|
||||
targetLeft = 0 if targetTop < 0
|
||||
targetLeft = Infinity if row > @model.getLastScreenRow()
|
||||
row = Math.min(row, @model.getLastScreenRow())
|
||||
|
||||
@prepareScreenRowsForMeasurement([row]) unless measureVisibleLinesOnly
|
||||
|
||||
|
||||
Reference in New Issue
Block a user