mirror of
https://github.com/neovim/neovim.git
synced 2025-11-04 09:44:31 +00:00
test: listchars
This commit is contained in:
committed by
Justin M. Keyes
parent
4eb4a5cdb2
commit
723497f030
@@ -369,6 +369,7 @@ describe("'cursorline' with 'listchars'", function()
|
|||||||
NonText = Screen.colors.Blue,
|
NonText = Screen.colors.Blue,
|
||||||
Cursorline = Screen.colors.Grey90,
|
Cursorline = Screen.colors.Grey90,
|
||||||
SpecialKey = Screen.colors.Red,
|
SpecialKey = Screen.colors.Red,
|
||||||
|
Visual = Screen.colors.LightGrey,
|
||||||
}
|
}
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
@@ -478,7 +479,7 @@ describe("'cursorline' with 'listchars'", function()
|
|||||||
execute('highlight SpecialKey guifg=#FF0000')
|
execute('highlight SpecialKey guifg=#FF0000')
|
||||||
execute('set cursorline')
|
execute('set cursorline')
|
||||||
execute('set tabstop=8')
|
execute('set tabstop=8')
|
||||||
execute('set listchars=space:.,eol:¬,tab:>-,extends:],precedes:[,trail:* list')
|
execute('set listchars=space:.,eol:¬,tab:>-,extends:>,precedes:<,trail:* list')
|
||||||
feed('i\t abcd <cr>\t abcd <cr><esc>k')
|
feed('i\t abcd <cr>\t abcd <cr><esc>k')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{5:>-------.}abcd{5:*}{4:¬} |
|
{5:>-------.}abcd{5:*}{4:¬} |
|
||||||
@@ -503,5 +504,110 @@ describe("'cursorline' with 'listchars'", function()
|
|||||||
{4:~ }|
|
{4:~ }|
|
||||||
:set nocursorline |
|
:set nocursorline |
|
||||||
]])
|
]])
|
||||||
|
execute('set nowrap')
|
||||||
|
feed('ALorem ipsum dolor sit amet<ESC>0')
|
||||||
|
screen:expect([[
|
||||||
|
{5:^>-------.}abcd{5:.}Lorem{4:>}|
|
||||||
|
{5:>-------.}abcd{5:*}{4:¬} |
|
||||||
|
{4:¬} |
|
||||||
|
{4:~ }|
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
execute('set cursorline')
|
||||||
|
screen:expect([[
|
||||||
|
{2:^>-------.}{1:abcd}{2:.}{1:Lorem}{4:>}|
|
||||||
|
{5:>-------.}abcd{5:*}{4:¬} |
|
||||||
|
{4:¬} |
|
||||||
|
{4:~ }|
|
||||||
|
:set cursorline |
|
||||||
|
]])
|
||||||
|
feed('$')
|
||||||
|
screen:expect([[
|
||||||
|
{4:<}{1:r}{2:.}{1:sit}{2:.}{1:ame^t}{3:¬}{1: }|
|
||||||
|
{4:<} |
|
||||||
|
{4:<} |
|
||||||
|
{4:~ }|
|
||||||
|
:set cursorline |
|
||||||
|
]])
|
||||||
|
feed('G')
|
||||||
|
screen:expect([[
|
||||||
|
{5:>-------.}abcd{5:.}Lorem{4:>}|
|
||||||
|
{5:>-------.}abcd{5:*}{4:¬} |
|
||||||
|
{3:^¬}{1: }|
|
||||||
|
{4:~ }|
|
||||||
|
:set cursorline |
|
||||||
|
]])
|
||||||
|
end)
|
||||||
|
|
||||||
|
it("'listchar' in visual mode", function()
|
||||||
|
screen:set_default_attr_ids({
|
||||||
|
[1] = {background=hlgroup_colors.Cursorline},
|
||||||
|
[2] = {
|
||||||
|
foreground=hlgroup_colors.SpecialKey,
|
||||||
|
background=hlgroup_colors.Cursorline,
|
||||||
|
},
|
||||||
|
[3] = {
|
||||||
|
background=hlgroup_colors.Cursorline,
|
||||||
|
foreground=hlgroup_colors.NonText,
|
||||||
|
bold=true,
|
||||||
|
},
|
||||||
|
[4] = {
|
||||||
|
foreground=hlgroup_colors.NonText,
|
||||||
|
bold=true,
|
||||||
|
},
|
||||||
|
[5] = {
|
||||||
|
foreground=hlgroup_colors.SpecialKey,
|
||||||
|
},
|
||||||
|
[6] = {
|
||||||
|
background=hlgroup_colors.Visual,
|
||||||
|
},
|
||||||
|
[7] = {
|
||||||
|
background=hlgroup_colors.Visual,
|
||||||
|
foreground=hlgroup_colors.SpecialKey,
|
||||||
|
},
|
||||||
|
[8] = {
|
||||||
|
background=hlgroup_colors.Visual,
|
||||||
|
foreground=hlgroup_colors.NonText,
|
||||||
|
bold=true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
execute('highlight clear ModeMsg')
|
||||||
|
execute('highlight SpecialKey guifg=#FF0000')
|
||||||
|
execute('set cursorline')
|
||||||
|
execute('set tabstop=8')
|
||||||
|
execute('set nowrap')
|
||||||
|
execute('set listchars=space:.,eol:¬,tab:>-,extends:>,precedes:<,trail:* list')
|
||||||
|
feed('i\t abcd <cr>\t abcd Lorem ipsum dolor sit amet<cr><esc>kkk0')
|
||||||
|
screen:expect([[
|
||||||
|
{2:^>-------.}{1:abcd}{2:*}{3:¬}{1: }|
|
||||||
|
{5:>-------.}abcd{5:.}Lorem{4:>}|
|
||||||
|
{4:¬} |
|
||||||
|
{4:~ }|
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
feed('lllvj')
|
||||||
|
screen:expect([[
|
||||||
|
{5:>-------.}a{6:bcd}{7:*}{8:¬} |
|
||||||
|
{7:>-------.}{6:a}^bcd{5:.}Lorem{4:>}|
|
||||||
|
{4:¬} |
|
||||||
|
{4:~ }|
|
||||||
|
-- VISUAL -- |
|
||||||
|
]])
|
||||||
|
feed('<esc>V')
|
||||||
|
screen:expect([[
|
||||||
|
{5:>-------.}abcd{5:*}{4:¬} |
|
||||||
|
{7:>-------.}{6:a}^b{6:cd}{7:.}{6:Lorem}{4:>}|
|
||||||
|
{4:¬} |
|
||||||
|
{4:~ }|
|
||||||
|
-- VISUAL LINE -- |
|
||||||
|
]])
|
||||||
|
feed('<esc>$')
|
||||||
|
screen:expect([[
|
||||||
|
{4:<} |
|
||||||
|
{4:<}{1:r}{2:.}{1:sit}{2:.}{1:ame^t}{3:¬}{1: }|
|
||||||
|
{4:<} |
|
||||||
|
{4:~ }|
|
||||||
|
|
|
||||||
|
]])
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user