diff --git a/src/lines-component.coffee b/src/lines-component.coffee index 7334c4b81..386583534 100644 --- a/src/lines-component.coffee +++ b/src/lines-component.coffee @@ -169,14 +169,13 @@ LinesComponent = React.createClass buildLineInnerHTML: (id) -> {editor} = @props {indentGuidesVisible} = @newState - {tokens, text} = @newState.lines[id] + {tokens, text, isOnlyWhitespace} = @newState.lines[id] innerHTML = "" scopeStack = [] - lineIsWhitespaceOnly = line.isOnlyWhitespace() for token in tokens innerHTML += @updateScopeStack(scopeStack, token.scopes) - hasIndentGuide = indentGuidesVisible and (token.hasLeadingWhitespace() or (token.hasTrailingWhitespace() and lineIsWhitespaceOnly)) + hasIndentGuide = indentGuidesVisible and (token.hasLeadingWhitespace() or (token.hasTrailingWhitespace() and isOnlyWhitespace)) innerHTML += token.getValueAsHtml({hasIndentGuide}) innerHTML += @popScope(scopeStack) while scopeStack.length > 0 diff --git a/src/text-editor-presenter.coffee b/src/text-editor-presenter.coffee index aeff452a5..7e88c0a87 100644 --- a/src/text-editor-presenter.coffee +++ b/src/text-editor-presenter.coffee @@ -181,6 +181,7 @@ class TextEditorPresenter screenRow: row text: line.text tokens: line.tokens + isOnlyWhitespace: line.isOnlyWhitespace() endOfLineInvisibles: line.endOfLineInvisibles indentLevel: line.indentLevel tabLength: line.tabLength