Merge pull request #8558 from atom/ns-simplify-page-up-down

Simplify page-up/page-down
This commit is contained in:
Nathan Sobo
2015-08-28 14:55:24 -06:00
2 changed files with 2 additions and 17 deletions

View File

@@ -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