mirror of
https://github.com/atom/atom.git
synced 2026-02-14 08:35:11 -05:00
Render trailing carriage return as an invisible
This commit is contained in:
committed by
Kevin Sawicki & Nathan Sobo
parent
c16acc6b2c
commit
ecc50506c7
@@ -311,9 +311,10 @@ class Editor extends View
|
||||
|
||||
setInvisibles: (@invisibles={}) ->
|
||||
_.defaults @invisibles,
|
||||
eol: '\u00ac',
|
||||
space: '\u2022',
|
||||
eol: '\u00ac'
|
||||
space: '\u2022'
|
||||
tab: '\u00bb'
|
||||
cr: '\u00a4'
|
||||
@resetDisplay()
|
||||
|
||||
checkoutHead: -> @getBuffer().checkoutHead()
|
||||
|
||||
@@ -80,5 +80,8 @@ class Token
|
||||
if hasTrailingWhitespace
|
||||
html = html.replace /[ ]+$/, (match) ->
|
||||
"<span class='invisible'>#{match.replace(/./g, invisibles.space)}</span>"
|
||||
if invisibles.cr
|
||||
html = html.replace /\r$/, (match) ->
|
||||
"<span class='invisible'>#{invisibles.cr}</span>"
|
||||
|
||||
html
|
||||
|
||||
Reference in New Issue
Block a user