Add ability to scroll past the end of the file

Fixes #3592
This commit is contained in:
Lee Dohm
2014-09-24 07:14:42 -07:00
parent 409816ef07
commit 2c3bec7468
2 changed files with 8 additions and 2 deletions

View File

@@ -315,9 +315,14 @@ class DisplayBuffer extends Model
@charWidthsByScope = {}
getScrollHeight: ->
return 0 unless @getLineHeightInPixels() > 0
lineHeight = @getLineHeightInPixels()
return 0 unless lineHeight > 0
@getLineCount() * @getLineHeightInPixels()
scrollHeight = @getLineCount() * lineHeight
if @height? and atom.config.get('editor.scrollPastEnd')
scrollHeight = scrollHeight + @height - (lineHeight * 3)
scrollHeight
getScrollWidth: ->
@scrollWidth

View File

@@ -60,6 +60,7 @@ class TextEditorView extends View
space: '\u00b7'
tab: '\u00bb'
cr: '\u00a4'
scrollPastEnd: false
@content: (params) ->
attributes = params.attributes ? {}