mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Put EOL invisibles into their own scope
This commit is contained in:
@@ -106,6 +106,8 @@ describe "EditorComponent", ->
|
||||
expect(component.lineNodeForScreenRow(0).textContent).toBe "#{invisibles.space}a line with tabs#{invisibles.tab} and spaces#{invisibles.space}#{invisibles.eol}"
|
||||
|
||||
it "displays newlines as their own token outside of the other tokens scope", ->
|
||||
editor.setText "var"
|
||||
expect(component.lineNodeForScreenRow(0).innerHTML).toBe "<span class=\"source js\"><span class=\"storage modifier js\">var</span></span><span class=\"invisible-character\">#{invisibles.eol}</span>"
|
||||
|
||||
it "allows invisible glyphs to be customized via the editor.invisibles config", ->
|
||||
|
||||
|
||||
@@ -146,8 +146,9 @@ LinesComponent = React.createClass
|
||||
innerHTML += @updateScopeStack(scopeStack, token.scopes)
|
||||
hasIndentGuide = not mini and showIndentGuide and token.hasLeadingWhitespace or (token.hasTrailingWhitespace and lineIsWhitespaceOnly)
|
||||
innerHTML += token.getValueAsHtml({invisibles, hasIndentGuide})
|
||||
|
||||
innerHTML += @popScope(scopeStack) while scopeStack.length > 0
|
||||
innerHTML += invisibles.eol if invisibles.eol?
|
||||
innerHTML += "<span class='invisible-character'>#{invisibles.eol}</span>"
|
||||
innerHTML
|
||||
|
||||
updateScopeStack: (scopeStack, desiredScopes) ->
|
||||
|
||||
Reference in New Issue
Block a user