Supply missing softWrapHangingIndent parameter to display layer

This commit is contained in:
Max Brunsfeld 2016-08-02 16:20:23 -07:00
parent c7b7eace22
commit 43f34f73da
2 changed files with 13 additions and 1 deletions

View File

@ -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)

View File

@ -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: ->