diff --git a/spec/editor-view-spec.coffee b/spec/editor-view-spec.coffee index d01ed45e5..fac5bc28a 100644 --- a/spec/editor-view-spec.coffee +++ b/spec/editor-view-spec.coffee @@ -1803,6 +1803,13 @@ describe "EditorView", -> expect(editorView.renderedLines.find('.line:eq(10) .indent-guide').text()).toBe "#{eol} " expect(editorView.renderedLines.find('.line:eq(10) .invisible-character').text()).toBe eol + describe "when editor.showIndentGuide is set to false", -> + it "does not render the indent guide on whitespace only lines (regression)", -> + editorView.attachToDom() + editor.setText(' ') + atom.config.set('editor.showIndentGuide', false) + expect(editorView.renderedLines.find('.line:eq(0) .indent-guide').length).toBe 0 + describe "when soft-wrap is enabled", -> beforeEach -> jasmine.unspy(window, 'setTimeout') diff --git a/src/editor-view.coffee b/src/editor-view.coffee index 6aa18dd2a..2b69becd1 100644 --- a/src/editor-view.coffee +++ b/src/editor-view.coffee @@ -1490,7 +1490,7 @@ class EditorView extends View position = 0 for token in tokens @updateScopeStack(line, scopeStack, token.scopes) - hasIndentGuide = not mini and showIndentGuide and token.hasLeadingWhitespace or (token.hasTrailingWhitespace and lineIsWhitespaceOnly) + hasIndentGuide = not mini and showIndentGuide and (token.hasLeadingWhitespace or (token.hasTrailingWhitespace and lineIsWhitespaceOnly)) line.push(token.getValueAsHtml({invisibles, hasIndentGuide})) position += token.value.length