mirror of
https://github.com/neovim/neovim.git
synced 2026-08-28 18:11:47 +00:00
'listchars': Whitespace highlight group #6367
This commit is contained in:
committed by
Justin M. Keyes
parent
6afa7d66cd
commit
bc6d868d00
@@ -30,8 +30,8 @@ describe('ui/cursor', function()
|
||||
blinkwait = 700,
|
||||
cell_percentage = 25,
|
||||
cursor_shape = 'vertical',
|
||||
hl_id = 45,
|
||||
id_lm = 46,
|
||||
hl_id = 46,
|
||||
id_lm = 47,
|
||||
mouse_shape = 0,
|
||||
short_name = 'ci' },
|
||||
cmdline_normal = {
|
||||
@@ -40,8 +40,8 @@ describe('ui/cursor', function()
|
||||
blinkwait = 700,
|
||||
cell_percentage = 0,
|
||||
cursor_shape = 'block',
|
||||
hl_id = 45,
|
||||
id_lm = 46,
|
||||
hl_id = 46,
|
||||
id_lm = 47,
|
||||
mouse_shape = 0,
|
||||
short_name = 'c' },
|
||||
cmdline_replace = {
|
||||
@@ -50,8 +50,8 @@ describe('ui/cursor', function()
|
||||
blinkwait = 700,
|
||||
cell_percentage = 20,
|
||||
cursor_shape = 'horizontal',
|
||||
hl_id = 45,
|
||||
id_lm = 46,
|
||||
hl_id = 46,
|
||||
id_lm = 47,
|
||||
mouse_shape = 0,
|
||||
short_name = 'cr' },
|
||||
insert = {
|
||||
@@ -60,8 +60,8 @@ describe('ui/cursor', function()
|
||||
blinkwait = 700,
|
||||
cell_percentage = 25,
|
||||
cursor_shape = 'vertical',
|
||||
hl_id = 45,
|
||||
id_lm = 46,
|
||||
hl_id = 46,
|
||||
id_lm = 47,
|
||||
mouse_shape = 0,
|
||||
short_name = 'i' },
|
||||
more = {
|
||||
@@ -76,8 +76,8 @@ describe('ui/cursor', function()
|
||||
blinkwait = 700,
|
||||
cell_percentage = 0,
|
||||
cursor_shape = 'block',
|
||||
hl_id = 45,
|
||||
id_lm = 46,
|
||||
hl_id = 46,
|
||||
id_lm = 47,
|
||||
mouse_shape = 0,
|
||||
short_name = 'n' },
|
||||
operator = {
|
||||
@@ -86,8 +86,8 @@ describe('ui/cursor', function()
|
||||
blinkwait = 700,
|
||||
cell_percentage = 50,
|
||||
cursor_shape = 'horizontal',
|
||||
hl_id = 45,
|
||||
id_lm = 45,
|
||||
hl_id = 46,
|
||||
id_lm = 46,
|
||||
mouse_shape = 0,
|
||||
short_name = 'o' },
|
||||
replace = {
|
||||
@@ -96,8 +96,8 @@ describe('ui/cursor', function()
|
||||
blinkwait = 700,
|
||||
cell_percentage = 20,
|
||||
cursor_shape = 'horizontal',
|
||||
hl_id = 45,
|
||||
id_lm = 46,
|
||||
hl_id = 46,
|
||||
id_lm = 47,
|
||||
mouse_shape = 0,
|
||||
short_name = 'r' },
|
||||
showmatch = {
|
||||
@@ -106,8 +106,8 @@ describe('ui/cursor', function()
|
||||
blinkwait = 175,
|
||||
cell_percentage = 0,
|
||||
cursor_shape = 'block',
|
||||
hl_id = 45,
|
||||
id_lm = 45,
|
||||
hl_id = 46,
|
||||
id_lm = 46,
|
||||
short_name = 'sm' },
|
||||
statusline_drag = {
|
||||
mouse_shape = 0,
|
||||
@@ -121,8 +121,8 @@ describe('ui/cursor', function()
|
||||
blinkwait = 700,
|
||||
cell_percentage = 0,
|
||||
cursor_shape = 'block',
|
||||
hl_id = 45,
|
||||
id_lm = 46,
|
||||
hl_id = 46,
|
||||
id_lm = 47,
|
||||
mouse_shape = 0,
|
||||
short_name = 'v' },
|
||||
visual_select = {
|
||||
@@ -131,8 +131,8 @@ describe('ui/cursor', function()
|
||||
blinkwait = 700,
|
||||
cell_percentage = 35,
|
||||
cursor_shape = 'vertical',
|
||||
hl_id = 45,
|
||||
id_lm = 45,
|
||||
hl_id = 46,
|
||||
id_lm = 46,
|
||||
mouse_shape = 0,
|
||||
short_name = 've' },
|
||||
vsep_drag = {
|
||||
|
||||
@@ -200,57 +200,30 @@ describe('Default highlight groups', function()
|
||||
|
||||
it('insert mode text', function()
|
||||
feed('i')
|
||||
screen:try_resize(53, 4)
|
||||
screen:expect([[
|
||||
^ |
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{1:-- INSERT --} |
|
||||
]], {[0] = {bold=true, foreground=Screen.colors.Blue},
|
||||
[1] = {bold = true}})
|
||||
end)
|
||||
|
||||
it('end of file markers', function()
|
||||
screen:try_resize(53, 4)
|
||||
screen:expect([[
|
||||
^ |
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
|
|
||||
]], {[1] = {bold = true, foreground = Screen.colors.Blue}})
|
||||
end)
|
||||
|
||||
it('"wait return" text', function()
|
||||
screen:try_resize(53, 4)
|
||||
feed(':ls<cr>')
|
||||
screen:expect([[
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
:ls |
|
||||
1 %a "[No Name]" line 1 |
|
||||
@@ -259,23 +232,15 @@ describe('Default highlight groups', function()
|
||||
[1] = {bold = true, foreground = Screen.colors.SeaGreen}})
|
||||
feed('<cr>') -- skip the "Press ENTER..." state or tests will hang
|
||||
end)
|
||||
|
||||
it('can be cleared and linked to other highlight groups', function()
|
||||
screen:try_resize(53, 4)
|
||||
execute('highlight clear ModeMsg')
|
||||
feed('i')
|
||||
screen:expect([[
|
||||
^ |
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
-- INSERT -- |
|
||||
]], {[0] = {bold=true, foreground=Screen.colors.Blue},
|
||||
[1] = {bold=true}})
|
||||
@@ -287,37 +252,19 @@ describe('Default highlight groups', function()
|
||||
^ |
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{1:-- INSERT --} |
|
||||
]], {[0] = {bold=true, foreground=Screen.colors.Blue},
|
||||
[1] = {foreground = Screen.colors.Red, background = Screen.colors.Green}})
|
||||
end)
|
||||
|
||||
it('can be cleared by assigning NONE', function()
|
||||
screen:try_resize(53, 4)
|
||||
execute('syn keyword TmpKeyword neovim')
|
||||
execute('hi link TmpKeyword ErrorMsg')
|
||||
insert('neovim')
|
||||
screen:expect([[
|
||||
{1:neovi^m} |
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
|
|
||||
]], {
|
||||
@@ -330,18 +277,34 @@ describe('Default highlight groups', function()
|
||||
neovi^m |
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
|
|
||||
]], {[0] = {bold=true, foreground=Screen.colors.Blue}})
|
||||
end)
|
||||
|
||||
it('Whitespace highlight', function()
|
||||
screen:try_resize(53, 4)
|
||||
execute('highlight NonText gui=NONE guifg=#FF0000')
|
||||
execute('set listchars=space:.,tab:>-,trail:*,eol:¬ list')
|
||||
insert(' ne \t o\tv im ')
|
||||
screen:expect([[
|
||||
ne{0:.>----.}o{0:>-----}v{0:..}im{0:*^*¬} |
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
|
|
||||
]], {[0] = {bold=true, foreground=Screen.colors.Blue}})
|
||||
]], {
|
||||
[0] = {foreground=Screen.colors.Red},
|
||||
[1] = {foreground=Screen.colors.Blue},
|
||||
})
|
||||
execute('highlight Whitespace gui=NONE guifg=#0000FF')
|
||||
screen:expect([[
|
||||
ne{1:.>----.}o{1:>-----}v{1:..}im{1:*^*}{0:¬} |
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
:highlight Whitespace gui=NONE guifg=#0000FF |
|
||||
]], {
|
||||
[0] = {foreground=Screen.colors.Red},
|
||||
[1] = {foreground=Screen.colors.Blue},
|
||||
})
|
||||
end)
|
||||
end)
|
||||
|
||||
@@ -510,7 +473,7 @@ describe("'listchars' highlight", function()
|
||||
},
|
||||
})
|
||||
execute('highlight clear ModeMsg')
|
||||
execute('highlight SpecialKey guifg=#FF0000')
|
||||
execute('highlight Whitespace guifg=#FF0000')
|
||||
execute('set cursorline')
|
||||
execute('set tabstop=8')
|
||||
execute('set listchars=space:.,eol:¬,tab:>-,extends:>,precedes:<,trail:* list')
|
||||
@@ -606,7 +569,7 @@ describe("'listchars' highlight", function()
|
||||
},
|
||||
})
|
||||
execute('highlight clear ModeMsg')
|
||||
execute('highlight SpecialKey guifg=#FF0000')
|
||||
execute('highlight Whitespace guifg=#FF0000')
|
||||
execute('set cursorline')
|
||||
execute('set tabstop=8')
|
||||
execute('set nowrap')
|
||||
@@ -653,7 +616,7 @@ describe("'listchars' highlight", function()
|
||||
[3] = {foreground=Screen.colors.Green1},
|
||||
})
|
||||
execute('highlight clear ModeMsg')
|
||||
execute('highlight SpecialKey guifg=#FF0000')
|
||||
execute('highlight Whitespace guifg=#FF0000')
|
||||
execute('highlight Error guifg=#00FF00')
|
||||
execute('set nowrap')
|
||||
feed('ia \t bc \t <esc>')
|
||||
|
||||
Reference in New Issue
Block a user