Implement TextEditor.prototype.getRowsPerPage

This commit is contained in:
Antonio Scandurra
2017-04-19 13:16:34 +02:00
parent 9ccfd3415c
commit f9cb1f87a7

View File

@@ -3485,9 +3485,12 @@ class TextEditor extends Model
# Returns the number of rows per page
getRowsPerPage: ->
Math.max(@rowsPerPage ? 1, 1)
setRowsPerPage: (@rowsPerPage) ->
if @component?
clientHeight = @component.getScrollContainerClientHeight()
lineHeight = @component.getLineHeight()
Math.max(1, Math.ceil(clientHeight / lineHeight))
else
1
###
Section: Config