mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Render fold lines with the 'fold' class and remove old fold placeholder support
This commit is contained in:
@@ -461,18 +461,17 @@ class Editor extends View
|
||||
charWidth = @charWidth
|
||||
charHeight = @charHeight
|
||||
lines = @renderer.linesForRows(startRow, endRow)
|
||||
|
||||
$$ ->
|
||||
for line in lines
|
||||
@div class: 'line', =>
|
||||
appendNbsp = true
|
||||
for token in line.tokens
|
||||
if token.type is 'fold-placeholder'
|
||||
@span ' ', class: 'fold-placeholder', style: "width: #{3 * charWidth}px; height: #{charHeight}px;", 'foldId': token.fold.id, =>
|
||||
@div class: "ellipsis", => @raw "…"
|
||||
else
|
||||
appendNbsp = false
|
||||
lineClass = 'line'
|
||||
lineClass += ' fold' if line.fold?
|
||||
@div class: lineClass, =>
|
||||
if line.text == ''
|
||||
@raw ' ' if line.text == ''
|
||||
else
|
||||
for token in line.tokens
|
||||
@span { class: token.type.replace('.', ' ') }, token.value
|
||||
@raw ' ' if appendNbsp
|
||||
|
||||
insertLineElements: (row, lineElements) ->
|
||||
@spliceLineElements(row, 0, lineElements)
|
||||
|
||||
Reference in New Issue
Block a user