mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 18:24:09 +03:00
Don't add EOL invisible if line is soft wrapped
This commit is contained in:
parent
6218b58fd4
commit
fa5ceedfe0
@ -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)
|
||||
|
@ -1079,7 +1079,7 @@ class Editor extends View
|
||||
if invisibles and not @mini
|
||||
if invisibles.cr and screenLine.lineEnding is '\r\n'
|
||||
line.push("<span class='invisible'>#{invisibles.cr}</span>")
|
||||
if invisibles.eol
|
||||
if invisibles.eol and not screenLine.isSoftWrapped()
|
||||
line.push("<span class='invisible'>#{invisibles.eol}</span>")
|
||||
|
||||
line.push('</pre>')
|
||||
|
Loading…
Reference in New Issue
Block a user