From 43f34f73da29d46b9cfe741c910b20212d9af21d Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 2 Aug 2016 16:20:23 -0700 Subject: [PATCH] Supply missing softWrapHangingIndent parameter to display layer --- spec/text-editor-spec.coffee | 11 +++++++++++ src/text-editor.coffee | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/spec/text-editor-spec.coffee b/spec/text-editor-spec.coffee index c3de3dbc6..706a04acc 100644 --- a/spec/text-editor-spec.coffee +++ b/spec/text-editor-spec.coffee @@ -6036,6 +6036,17 @@ describe "TextEditor", -> editor.setEditorWidthInChars(10) expect(editor.lineTextForScreenRow(0)).toBe 'var ' + describe "the softWrapHangingIndent setting", -> + it "controls how much extra indentation is applied to soft-wrapped lines", -> + editor.setText('123456789') + editor.setEditorWidthInChars(8) + atom.config.set('editor.softWrap', true) + atom.config.set('editor.softWrapHangingIndent', 2) + expect(editor.lineTextForScreenRow(1)).toEqual ' 9' + + atom.config.set('editor.softWrapHangingIndent', 4) + expect(editor.lineTextForScreenRow(1)).toEqual ' 9' + describe "::getElement", -> it "returns an element", -> expect(editor.getElement() instanceof HTMLElement).toBe(true) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 1a3f83232..c7b7dd4b7 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -265,7 +265,8 @@ class TextEditor extends Model tabLength: @getTabLength(), ratioForCharacter: @ratioForCharacter.bind(this), isWrapBoundary: isWrapBoundary, - foldCharacter: ZERO_WIDTH_NBSP + foldCharacter: ZERO_WIDTH_NBSP, + softWrapHangingIndent: @config.get('editor.softWrapHangingIndent', scope: @getRootScopeDescriptor()) }) destroyed: ->