diff --git a/spec/text-editor-spec.coffee b/spec/text-editor-spec.coffee index e1af7c46c..17ce81301 100644 --- a/spec/text-editor-spec.coffee +++ b/spec/text-editor-spec.coffee @@ -5507,8 +5507,8 @@ describe "TextEditor", -> expect(editor.getScrollPastEnd()).toBe(false) describe "auto height", -> - it "returns undefined by default but can be customized", -> - expect(editor.getAutoHeight()).toBeUndefined() + it "returns true by default but can be customized", -> + expect(editor.getAutoHeight()).toBe(true) editor.update({autoHeight: false}) expect(editor.getAutoHeight()).toBe(false) editor.update({autoHeight: true}) diff --git a/src/text-editor-component.coffee b/src/text-editor-component.coffee index 08fdbb9a8..8355c7fa5 100644 --- a/src/text-editor-component.coffee +++ b/src/text-editor-component.coffee @@ -57,7 +57,7 @@ class TextEditorComponent cursorBlinkResumeDelay: @cursorBlinkResumeDelay stoppedScrollingDelay: 200 lineTopIndex: lineTopIndex - autoHeight: @editor.getAutoHeight() ? true + autoHeight: @editor.getAutoHeight() @presenter.onDidUpdateState(@requestUpdate) @@ -759,7 +759,7 @@ class TextEditorComponent # auto-height in certain circumstances. This is legacy behavior that we # would rather not implement, but we can't remove it without risking # breakage currently. - unless @editor.getAutoHeight()? + unless @editor.autoHeight? {position, top, bottom} = getComputedStyle(@hostElement) hasExplicitTopAndBottom = (position is 'absolute' and top isnt 'auto' and bottom isnt 'auto') diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 89e5aaf49..42cfaa9b5 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -3542,7 +3542,7 @@ class TextEditor extends Model Grim.deprecate("This is now a view method. Call TextEditorElement::getHeight instead.") @height - getAutoHeight: -> @autoHeight + getAutoHeight: -> @autoHeight ? true setWidth: (width, reentrant=false) -> if reentrant