diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index 7a9f98d07..0aca4b840 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -1551,6 +1551,15 @@ describe "Editor", -> expect(editor.renderedLines.find('.line:eq(10) .indent-guide').length).toBe 2 expect(editor.renderedLines.find('.line:eq(10) .indent-guide').text()).toBe ' ' + describe "when the line has leading and trailing whitespace", -> + it "does not display the indent guide in the trailing whitespace", -> + editor.attachToDom() + config.set("editor.showIndentGuide", true) + + editor.insertText("/*\n * \n*/") + expect(editor.renderedLines.find('.line:eq(1) .indent-guide').length).toBe 1 + expect(editor.renderedLines.find('.line:eq(1) .indent-guide')).toHaveClass('leading-whitespace') + describe "when the line is empty and end of show invisibles are enabled", -> it "renders the indent guides interleaved the end of line invisibles", -> editor.attachToDom() diff --git a/src/app/token.coffee b/src/app/token.coffee index 01707dd2d..de78a0457 100644 --- a/src/app/token.coffee +++ b/src/app/token.coffee @@ -92,7 +92,7 @@ class Token "#{match}" if hasTrailingWhitespace classes = [] - classes.push('indent-guide') if hasIndentGuide + classes.push('indent-guide') if hasIndentGuide and not hasLeadingWhitespace classes.push('invisible-character') if invisibles.space classes.push('trailing-whitespace') classes = classes.join(' ')