mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Don't activate scrollPastEnd for autoHeight editors
This commit is contained in:
@@ -19,7 +19,7 @@ describe('TextEditorRegistry', function () {
|
||||
packageManager: {deferredActivationHooks: null}
|
||||
})
|
||||
|
||||
editor = new TextEditor()
|
||||
editor = new TextEditor({autoHeight: false})
|
||||
})
|
||||
|
||||
afterEach(function () {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user