mirror of
https://github.com/atom/atom.git
synced 2026-01-26 23:38:48 -05:00
Store ‘isOnlyWhitespace’ in line presenter state
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user