Store ‘isOnlyWhitespace’ in line presenter state

Esse commit está contido em:
Nathan Sobo
2015-02-04 07:59:34 -07:00
commit 6977660699
2 arquivos alterados com 3 adições e 3 exclusões
+2 -3
Ver Arquivo
@@ -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
+1
Ver Arquivo
@@ -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