From ce1c1ff08174023edd9bb867ca01b0381b6f90bf Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 21 May 2012 13:38:39 -0700 Subject: [PATCH] Render fold lines with the 'fold' class and remove old fold placeholder support --- src/app/editor.coffee | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/app/editor.coffee b/src/app/editor.coffee index e52e296f9..b1b345d46 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -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)