Base the visible lines on the height instead of the clientHeight

Because overlay scrollbars are invisible unless scrolling and even
regular scrollbars can be transparent.
This commit is contained in:
Nathan Sobo
2014-05-07 14:39:42 -06:00
parent f0fd48202c
commit ce5c29fb47

View File

@@ -239,7 +239,7 @@ class DisplayBuffer extends Model
unless @getLineHeight() > 0
throw new Error("You must assign a non-zero lineHeight before calling ::getVisibleRowRange()")
heightInLines = Math.ceil(@getClientHeight() / @getLineHeight()) + 1
heightInLines = Math.ceil(@getHeight() / @getLineHeight()) + 1
startRow = Math.floor(@getScrollTop() / @getLineHeight())
endRow = Math.min(@getLineCount(), Math.ceil(startRow + heightInLines))
[startRow, endRow]