mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Implement TextEditor.prototype.getRowsPerPage
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user