LineMap.bufferRowsForScreenRows stops traversing line map when endScreenRow is exceeded

This commit is contained in:
Corey Johnson
2012-05-14 09:51:42 -07:00
parent 73c51583e6
commit 63e9af6109

View File

@@ -34,7 +34,7 @@ class LineMap
linesForBufferRows: (startRow, endRow) ->
@linesByDelta('bufferDelta', startRow, endRow)
bufferRowsForScreenRows: (startRow, endRow=@lastScreenRow())->
bufferRowsForScreenRows: (startRow, endRow=@lastScreenRow()) ->
bufferRows = []
currentScreenRow = -1
@traverseByDelta 'screenDelta', [startRow, 0], [endRow, 0], ({ screenDelta, bufferDelta }) ->
@@ -158,6 +158,8 @@ class LineMap
traversalDelta = new Point
screenDelta = new Point
bufferDelta = new Point
startPosition = Point.fromObject(startPosition)
endPosition = Point.fromObject(endPosition)
for lineFragment, index in @lineFragments
iterator({ lineFragment, screenDelta, bufferDelta }) if traversalDelta.isGreaterThanOrEqual(startPosition) and iterator?