Always render a non-breaking space at the end of screen lines

This ensures that if the line only contains a placeholder that it still
has a single character to keep the line div at a consistent height with
other lines.
This commit is contained in:
Nathan Sobo
2012-03-08 12:20:28 -07:00
parent 6d303aad18
commit ee2ceb6bcb

View File

@@ -138,15 +138,13 @@ class Editor extends View
charHeight = @charHeight
$$ ->
@div class: 'line', =>
if tokens.length
for token in tokens
if token.type is 'fold-placeholder'
@span ' ', class: 'fold-placeholder', style: "width: #{3 * charWidth}px; height: #{charHeight * .85 }px;", 'foldId': token.fold.id, =>
@div class: "ellipsis", => @raw "…"
else
@span { class: token.type.replace('.', ' ') }, token.value
else
@raw ' '
for token in 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
@span { class: token.type.replace('.', ' ') }, token.value
@raw ' '
renderLines: ->
@lines.find('.line').remove()