mirror of
https://github.com/atom/atom.git
synced 2026-02-14 16:45:14 -05:00
Add class to hard tabs and leading/trailing spaces
This allows whitespace to be still be styled when invisibles are disabled.
This commit is contained in:
@@ -80,5 +80,16 @@ class Token
|
||||
if hasTrailingWhitespace
|
||||
html = html.replace /[ ]+$/, (match) ->
|
||||
"<span class='invisible trailing-whitespace'>#{match.replace(/./g, invisibles.space)}</span>"
|
||||
else
|
||||
if @isHardTab
|
||||
html = html.replace /^./, (match) ->
|
||||
"<span class='hard-tab'>#{match}</span>"
|
||||
else
|
||||
if hasLeadingWhitespace
|
||||
html = html.replace /^[ ]+/, (match) ->
|
||||
"<span class='leading-whitespace'>#{match}</span>"
|
||||
if hasTrailingWhitespace
|
||||
html = html.replace /[ ]+$/, (match) ->
|
||||
"<span class='trailing-whitespace'>#{match}</span>"
|
||||
|
||||
html
|
||||
|
||||
Reference in New Issue
Block a user