mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Render line-ending invisibles on empty lines
Fixes #2857 Including correct interleaving with indent guides.
This commit is contained in:
@@ -232,6 +232,28 @@ describe "EditorComponent", ->
|
||||
runSetImmediateCallbacks()
|
||||
expect(component.lineNodeForScreenRow(0).textContent).toBe "a line that ends with a carriage return#{invisibles.cr}#{invisibles.eol}"
|
||||
|
||||
it "renders invisible line-ending characters on empty lines", ->
|
||||
expect(component.lineNodeForScreenRow(10).textContent).toBe invisibles.eol
|
||||
|
||||
it "interleaves invisible line-ending characters with indent guides on empty lines", ->
|
||||
component.setShowIndentGuide(true)
|
||||
editor.setTextInBufferRange([[10, 0], [11, 0]], "\r\n", false)
|
||||
runSetImmediateCallbacks()
|
||||
expect(component.lineNodeForScreenRow(10).innerHTML).toBe '<span class="indent-guide"><span class="invisible-character">C</span><span class="invisible-character">E</span></span>'
|
||||
|
||||
editor.setTabLength(3)
|
||||
runSetImmediateCallbacks()
|
||||
expect(component.lineNodeForScreenRow(10).innerHTML).toBe '<span class="indent-guide"><span class="invisible-character">C</span><span class="invisible-character">E</span> </span>'
|
||||
|
||||
editor.setTabLength(1)
|
||||
runSetImmediateCallbacks()
|
||||
expect(component.lineNodeForScreenRow(10).innerHTML).toBe '<span class="indent-guide"><span class="invisible-character">C</span></span><span class="indent-guide"><span class="invisible-character">E</span></span>'
|
||||
|
||||
editor.setTextInBufferRange([[9, 0], [9, Infinity]], ' ')
|
||||
editor.setTextInBufferRange([[11, 0], [11, Infinity]], ' ')
|
||||
runSetImmediateCallbacks()
|
||||
expect(component.lineNodeForScreenRow(10).innerHTML).toBe '<span class="indent-guide"><span class="invisible-character">C</span></span><span class="invisible-character">E</span>'
|
||||
|
||||
describe "when soft wrapping is enabled", ->
|
||||
beforeEach ->
|
||||
editor.setText "a line that wraps "
|
||||
|
||||
Reference in New Issue
Block a user