Don't activate scrollPastEnd for autoHeight editors

This commit is contained in:
Antonio Scandurra
2017-05-04 14:36:42 +02:00
parent de2cfb5ef7
commit 001fef4a05
3 changed files with 12 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ describe('TextEditorRegistry', function () {
packageManager: {deferredActivationHooks: null}
})
editor = new TextEditor()
editor = new TextEditor({autoHeight: false})
})
afterEach(function () {

View File

@@ -5561,6 +5561,12 @@ describe "TextEditor", ->
editor.update({scrollPastEnd: false})
expect(editor.getScrollPastEnd()).toBe(false)
it "always returns false when autoHeight is on", ->
editor.update({autoHeight: true, scrollPastEnd: true})
expect(editor.getScrollPastEnd()).toBe(false)
editor.update({autoHeight: false})
expect(editor.getScrollPastEnd()).toBe(true)
describe "auto height", ->
it "returns true by default but can be customized", ->
editor = new TextEditor

View File

@@ -3546,7 +3546,11 @@ class TextEditor extends Model
# Experimental: Does this editor allow scrolling past the last line?
#
# Returns a {Boolean}.
getScrollPastEnd: -> @scrollPastEnd
getScrollPastEnd: ->
if @getAutoHeight()
false
else
@scrollPastEnd
# Experimental: How fast does the editor scroll in response to mouse wheel
# movements?