mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Move custom invisible glyph spec to editor spec
This commit is contained in:
@@ -1579,6 +1579,23 @@ describe "Editor", ->
|
||||
editor.setText "var"
|
||||
expect(editor.find('.line').html()).toBe '<span class="source js"><span class="storage modifier js">var</span></span><span class="invisible">¬</span>'
|
||||
|
||||
it "allows invisible glyphs to be customized via config.editor.invisibles", ->
|
||||
rootView.height(200)
|
||||
rootView.attachToDom()
|
||||
rightEditor = rootView.getActiveEditor()
|
||||
rightEditor.setText(" \t ")
|
||||
leftEditor = rightEditor.splitLeft()
|
||||
|
||||
config.editor.showInvisibles = true
|
||||
config.editor.invisibles =
|
||||
eol: ";"
|
||||
space: "_"
|
||||
tab: "tab"
|
||||
config.update()
|
||||
|
||||
expect(rightEditor.find(".line:first").text()).toBe "_tab _;"
|
||||
expect(leftEditor.find(".line:first").text()).toBe "_tab _;"
|
||||
|
||||
describe "gutter rendering", ->
|
||||
beforeEach ->
|
||||
editor.attachToDom(heightInLines: 5.5)
|
||||
|
||||
@@ -712,30 +712,3 @@ describe "RootView", ->
|
||||
|
||||
lowerRightEditor = rightEditor.splitDown()
|
||||
expect(lowerRightEditor.find(".line:first").text()).toBe " "
|
||||
|
||||
describe 'setInvisibles', ->
|
||||
it 'updates the display of all edit sessions with the new map', ->
|
||||
rootView.height(200)
|
||||
rootView.attachToDom()
|
||||
rightEditor = rootView.getActiveEditor()
|
||||
rightEditor.setText(" \t ")
|
||||
leftEditor = rightEditor.splitLeft()
|
||||
|
||||
rootView.setInvisibles
|
||||
eol: ";"
|
||||
space: "_"
|
||||
tab: "tab"
|
||||
|
||||
rootView.trigger "window:toggle-invisibles"
|
||||
expect(rightEditor.find(".line:first").text()).toBe "_tab _;"
|
||||
expect(leftEditor.find(".line:first").text()).toBe "_tab _;"
|
||||
|
||||
describe 'getInvisibles', ->
|
||||
it 'contains an eol key with a value', ->
|
||||
expect(rootView.getInvisibles().eol).toBe "¬"
|
||||
|
||||
it 'contains a space key with a value', ->
|
||||
expect(rootView.getInvisibles().space).toBe "•"
|
||||
|
||||
it 'contains a tab key with a value', ->
|
||||
expect(rootView.getInvisibles().tab).toBe "▸"
|
||||
|
||||
Reference in New Issue
Block a user