Set targetLeft to Infinity when past last row

This commit is contained in:
Kevin Sawicki
2014-10-16 17:05:47 -07:00
parent f81bc4b870
commit 8c136b18c2

View File

@@ -662,7 +662,7 @@ class DisplayBuffer extends Model
targetLeft = pixelPosition.left
defaultCharWidth = @defaultCharWidth
row = Math.floor(targetTop / @getLineHeightInPixels())
pastLastRow = row > @getLastRow()
targetLeft = Infinity if row > @getLastRow()
row = Math.min(row, @getLastRow())
row = Math.max(0, row)
@@ -672,7 +672,7 @@ class DisplayBuffer extends Model
charWidths = @getScopedCharWidths(token.scopeDescriptor)
for char in token.value
charWidth = charWidths[char] ? defaultCharWidth
break if not pastLastRow and targetLeft <= left + (charWidth / 2)
break if targetLeft <= left + (charWidth / 2)
left += charWidth
column++