diff --git a/spec/text-editor-spec.coffee b/spec/text-editor-spec.coffee index 1298727a9..8affb9b5f 100644 --- a/spec/text-editor-spec.coffee +++ b/spec/text-editor-spec.coffee @@ -5967,6 +5967,20 @@ describe "TextEditor", -> atom.config.set('editor.showInvisibles', true) expect(editor.lineTextForScreenRow(0).indexOf(atom.config.get('editor.invisibles.eol'))).toBe(-1) + describe "indent guides", -> + it "shows indent guides when `editor.showIndentGuide` is set to true and the editor is not mini", -> + editor.setText(" foo") + atom.config.set('editor.tabLength', 2) + + atom.config.set('editor.showIndentGuide', false) + expect(editor.tokensForScreenRow(0)).toEqual ['source.js', 'leading-whitespace'] + + atom.config.set('editor.showIndentGuide', true) + expect(editor.tokensForScreenRow(0)).toEqual ['source.js', 'leading-whitespace indent-guide'] + + editor.setMini(true) + expect(editor.tokensForScreenRow(0)).toEqual ['source.js', 'leading-whitespace'] + describe "when the editor is constructed with the grammar option set", -> beforeEach -> atom.workspace.destroyActivePane() diff --git a/src/text-editor.coffee b/src/text-editor.coffee index a0d384946..e3902b88c 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -257,7 +257,7 @@ class TextEditor extends Model @displayLayer.reset({ invisibles: @getInvisibles(), softWrapColumn: @getSoftWrapColumn(), - showIndentGuides: @config.get('editor.showIndentGuide', scope: @getRootScopeDescriptor()), + showIndentGuides: not @isMini() and @config.get('editor.showIndentGuide', scope: @getRootScopeDescriptor()), atomicSoftTabs: @config.get('editor.atomicSoftTabs', scope: @getRootScopeDescriptor()), tabLength: @getTabLength(), ratioForCharacter: @ratioForCharacter.bind(this), @@ -589,7 +589,8 @@ class TextEditor extends Model setMini: (mini) -> if mini isnt @mini @mini = mini - @setIgnoreInvisibles(@mini) + @ignoreInvisibles = @mini + @resetDisplayLayer() @emitter.emit 'did-change-mini', @mini @mini