From ee2ceb6bcb54acc739d379986c2b92f5cdb48ff2 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 8 Mar 2012 12:20:28 -0700 Subject: [PATCH] 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. --- src/atom/editor.coffee | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/atom/editor.coffee b/src/atom/editor.coffee index 92073c2ba..a27c75a14 100644 --- a/src/atom/editor.coffee +++ b/src/atom/editor.coffee @@ -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()