Add soft wrap support to invisibles

This commit is contained in:
probablycorey
2014-05-20 11:44:55 -07:00
parent 1e6e804ebb
commit 6880368a79
2 changed files with 7 additions and 2 deletions

View File

@@ -115,9 +115,14 @@ describe "EditorComponent", ->
describe "when soft wrapping is enabled", ->
beforeEach ->
editor.setText "a line that wraps "
editor.setSoftWrap(true)
node.style.width = 15 * charWidth + 'px'
component.measureHeightAndWidth()
it "doesn't show the end of line invisible at the end of lines broken due to wrapping", ->
it "doesn't show end of line invisibles at the end of wrapped lines", ->
expect(component.lineNodeForScreenRow(0).textContent).toBe "a line that "
expect(component.lineNodeForScreenRow(1).textContent).toBe "wraps#{invisibles.space}#{invisibles.eol}"
it "displays trailing carriage return using a visible non-empty value", ->

View File

@@ -152,7 +152,7 @@ LinesComponent = React.createClass
innerHTML
buildEndOfLineHTML: (line, invisibles) ->
return '' if @props.mini
return '' if @props.mini or line.isSoftWrapped()
eolInvisibles = []
eolInvisibles.push(invisibles.cr) if invisibles.cr? and line.lineEnding is '\r\n'