From fa5ceedfe006f4bfb5321fc912527a3d95614475 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 28 Jan 2013 13:22:32 -0800 Subject: [PATCH] Don't add EOL invisible if line is soft wrapped --- spec/app/editor-spec.coffee | 14 ++++++++++++++ src/app/editor.coffee | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index 445f2faf1..04241fae6 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -1618,6 +1618,20 @@ describe "Editor", -> expect(eol).toBeTruthy() expect(editor.renderedLines.find('.line:first').text()).toBe "a line that ends with a carriage return#{cr}#{eol}" + + describe "when wrapping is on", -> + it "doesn't show the end of line invisible at the end of lines broken due to wrapping", -> + editor.setSoftWrapColumn(6) + editor.setText "a line that wraps" + editor.attachToDom() + config.set "editor.showInvisibles", true + space = editor.invisibles?.space + expect(space).toBeTruthy() + eol = editor.invisibles?.eol + expect(eol).toBeTruthy() + expect(editor.renderedLines.find('.line:first').text()).toBe "a line#{space}" + expect(editor.renderedLines.find('.line:last').text()).toBe "wraps#{eol}" + describe "gutter rendering", -> beforeEach -> editor.attachToDom(heightInLines: 5.5) diff --git a/src/app/editor.coffee b/src/app/editor.coffee index b986c1e6a..775963830 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -1079,7 +1079,7 @@ class Editor extends View if invisibles and not @mini if invisibles.cr and screenLine.lineEnding is '\r\n' line.push("") - if invisibles.eol + if invisibles.eol and not screenLine.isSoftWrapped() line.push("") line.push('')