mirror of
https://github.com/atom/atom.git
synced 2026-02-14 08:35:11 -05:00
Merge pull request #8558 from atom/ns-simplify-page-up-down
Simplify page-up/page-down
This commit is contained in:
@@ -2898,14 +2898,10 @@ class TextEditor extends Model
|
||||
setVerticalScrollbarWidth: (width) -> @displayBuffer.setVerticalScrollbarWidth(width)
|
||||
|
||||
pageUp: ->
|
||||
newScrollTop = @getScrollTop() - @getHeight()
|
||||
@moveUp(@getRowsPerPage())
|
||||
@setScrollTop(newScrollTop)
|
||||
|
||||
pageDown: ->
|
||||
newScrollTop = @getScrollTop() + @getHeight()
|
||||
@moveDown(@getRowsPerPage())
|
||||
@setScrollTop(newScrollTop)
|
||||
|
||||
selectPageUp: ->
|
||||
@selectUp(@getRowsPerPage())
|
||||
@@ -2915,7 +2911,7 @@ class TextEditor extends Model
|
||||
|
||||
# Returns the number of rows per page
|
||||
getRowsPerPage: ->
|
||||
Math.max(1, Math.ceil(@getHeight() / @getLineHeightInPixels()))
|
||||
Math.max(1, Math.floor(@getHeight() / @getLineHeightInPixels()))
|
||||
|
||||
###
|
||||
Section: Config
|
||||
|
||||
Reference in New Issue
Block a user