refactor(tests): use more standard colors but with extra colors

This commit is contained in:
bfredl
2024-04-04 11:26:39 +02:00
parent 56701cd21e
commit e920d0f941
2 changed files with 587 additions and 765 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -30,18 +30,9 @@ describe('ui/ext_messages', function()
clear() clear()
screen = Screen.new(25, 5) screen = Screen.new(25, 5)
screen:attach({ rgb = true, ext_messages = true, ext_popupmenu = true }) screen:attach({ rgb = true, ext_messages = true, ext_popupmenu = true })
screen:set_default_attr_ids({ screen:add_extra_attr_ids {
[1] = { bold = true, foreground = Screen.colors.Blue1 }, [100] = { undercurl = true, special = Screen.colors.Red },
[2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red }, }
[3] = { bold = true },
[4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
[5] = { foreground = Screen.colors.Blue1 },
[6] = { bold = true, reverse = true },
[7] = { background = Screen.colors.Yellow },
[8] = { foreground = Screen.colors.Red },
[9] = { special = Screen.colors.Red, undercurl = true },
[10] = { foreground = Screen.colors.Brown },
})
end) end)
after_each(function() after_each(function()
os.remove(fname) os.remove(fname)
@@ -57,7 +48,7 @@ describe('ui/ext_messages', function()
]], ]],
messages = { messages = {
{ {
content = { { '\ntest\n[O]k: ', 4 } }, content = { { '\ntest\n[O]k: ', 6 } },
kind = 'confirm', kind = 'confirm',
}, },
}, },
@@ -85,7 +76,7 @@ describe('ui/ext_messages', function()
]], ]],
messages = { messages = {
{ {
content = { { '\ntest\n[O]k: ', 4 } }, content = { { '\ntest\n[O]k: ', 6 } },
kind = 'confirm', kind = 'confirm',
}, },
}, },
@@ -99,7 +90,7 @@ describe('ui/ext_messages', function()
]], ]],
messages = { messages = {
{ {
content = { { '\ntest\n[O]k: ', 4 } }, content = { { '\ntest\n[O]k: ', 6 } },
kind = 'confirm', kind = 'confirm',
}, },
{ {
@@ -107,7 +98,7 @@ describe('ui/ext_messages', function()
kind = 'echo', kind = 'echo',
}, },
{ {
content = { { 'Press ENTER or type command to continue', 4 } }, content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt', kind = 'return_prompt',
}, },
}, },
@@ -118,23 +109,13 @@ describe('ui/ext_messages', function()
feed(':%s/i/X/gc<cr>') feed(':%s/i/X/gc<cr>')
screen:expect { screen:expect {
grid = [[ grid = [[
l{7:i}ne 1 | l{2:i}ne 1 |
l{8:i}ne ^2 | l{10:i}ne ^2 |
{1:~ }|*3 {1:~ }|*3
]], ]],
attr_ids = {
[1] = { bold = true, foreground = Screen.colors.Blue1 },
[2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
[3] = { bold = true },
[4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
[5] = { foreground = Screen.colors.Blue1 },
[6] = { bold = true, reverse = true },
[7] = { reverse = true },
[8] = { background = Screen.colors.Yellow },
},
messages = { messages = {
{ {
content = { { 'replace with X (y/n/a/q/l/^E/^Y)?', 4 } }, content = { { 'replace with X (y/n/a/q/l/^E/^Y)?', 6 } },
kind = 'confirm_sub', kind = 'confirm_sub',
}, },
}, },
@@ -148,16 +129,12 @@ describe('ui/ext_messages', function()
screen:expect { screen:expect {
grid = [[ grid = [[
line 1 | line 1 |
{MATCH:.*}| line ^2 |
{1:~ }|*3 {1:~ }|*3
]], ]],
attr_ids = {
[1] = { bold = true, foreground = Screen.colors.Blue1 },
[7] = { foreground = Screen.colors.Red },
},
messages = { messages = {
{ {
content = { { 'W10: Warning: Changing a readonly file', 7 } }, content = { { 'W10: Warning: Changing a readonly file', 19 } },
kind = 'wmsg', kind = 'wmsg',
}, },
}, },
@@ -171,18 +148,9 @@ describe('ui/ext_messages', function()
line 2 | line 2 |
{1:~ }|*3 {1:~ }|*3
]], ]],
attr_ids = {
[1] = { bold = true, foreground = Screen.colors.Blue1 },
[2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
[3] = { bold = true },
[4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
[5] = { foreground = Screen.colors.Blue1 },
[6] = { bold = true, reverse = true },
[7] = { foreground = Screen.colors.Red },
},
messages = { messages = {
{ {
content = { { 'search hit BOTTOM, continuing at TOP', 7 } }, content = { { 'search hit BOTTOM, continuing at TOP', 19 } },
kind = 'wmsg', kind = 'wmsg',
}, },
}, },
@@ -198,15 +166,15 @@ describe('ui/ext_messages', function()
]], ]],
messages = { messages = {
{ {
content = { { 'Error detected while processing :', 2 } }, content = { { 'Error detected while processing :', 9 } },
kind = 'emsg', kind = 'emsg',
}, },
{ {
content = { { 'E605: Exception not caught: foo', 2 } }, content = { { 'E605: Exception not caught: foo', 9 } },
kind = '', kind = '',
}, },
{ {
content = { { 'Press ENTER or type command to continue', 4 } }, content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt', kind = 'return_prompt',
}, },
}, },
@@ -239,7 +207,7 @@ describe('ui/ext_messages', function()
{1:~ }|*4 {1:~ }|*4
]], ]],
messages = { { messages = { {
content = { { 'raa', 2 } }, content = { { 'raa', 9 } },
kind = 'echoerr', kind = 'echoerr',
} }, } },
} }
@@ -266,15 +234,15 @@ describe('ui/ext_messages', function()
]], ]],
messages = { messages = {
{ {
content = { { 'bork', 2 } }, content = { { 'bork', 9 } },
kind = 'echoerr', kind = 'echoerr',
}, },
{ {
content = { { 'fail', 2 } }, content = { { 'fail', 9 } },
kind = 'echoerr', kind = 'echoerr',
}, },
{ {
content = { { 'Press ENTER or type command to continue', 4 } }, content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt', kind = 'return_prompt',
}, },
}, },
@@ -288,19 +256,19 @@ describe('ui/ext_messages', function()
]], ]],
messages = { messages = {
{ {
content = { { 'bork', 2 } }, content = { { 'bork', 9 } },
kind = 'echoerr', kind = 'echoerr',
}, },
{ {
content = { { 'fail', 2 } }, content = { { 'fail', 9 } },
kind = 'echoerr', kind = 'echoerr',
}, },
{ {
content = { { 'extrafail', 2 } }, content = { { 'extrafail', 9 } },
kind = 'echoerr', kind = 'echoerr',
}, },
{ {
content = { { 'Press ENTER or type command to continue', 4 } }, content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt', kind = 'return_prompt',
}, },
}, },
@@ -322,7 +290,7 @@ describe('ui/ext_messages', function()
{1:~ }|*4 {1:~ }|*4
]], ]],
messages = { { messages = { {
content = { { 'problem', 2 } }, content = { { 'problem', 9 } },
kind = 'echoerr', kind = 'echoerr',
} }, } },
cmdline = { cmdline = {
@@ -350,15 +318,15 @@ describe('ui/ext_messages', function()
{1:~ }|*4 {1:~ }|*4
]], ]],
msg_history = { msg_history = {
{ kind = 'echoerr', content = { { 'raa', 2 } } }, { kind = 'echoerr', content = { { 'raa', 9 } } },
{ kind = 'echoerr', content = { { 'bork', 2 } } }, { kind = 'echoerr', content = { { 'bork', 9 } } },
{ kind = 'echoerr', content = { { 'fail', 2 } } }, { kind = 'echoerr', content = { { 'fail', 9 } } },
{ kind = 'echoerr', content = { { 'extrafail', 2 } } }, { kind = 'echoerr', content = { { 'extrafail', 9 } } },
{ kind = 'echoerr', content = { { 'problem', 2 } } }, { kind = 'echoerr', content = { { 'problem', 9 } } },
}, },
messages = { messages = {
{ {
content = { { 'Press ENTER or type command to continue', 4 } }, content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt', kind = 'return_prompt',
}, },
}, },
@@ -382,7 +350,7 @@ describe('ui/ext_messages', function()
{1:~ }|*4 {1:~ }|*4
]], ]],
messages = { { messages = { {
content = { { 'bork\nfail', 2 } }, content = { { 'bork\nfail', 9 } },
kind = 'echoerr', kind = 'echoerr',
} }, } },
} }
@@ -395,13 +363,13 @@ describe('ui/ext_messages', function()
]], ]],
messages = { messages = {
{ {
content = { { 'Press ENTER or type command to continue', 4 } }, content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt', kind = 'return_prompt',
}, },
}, },
msg_history = { msg_history = {
{ {
content = { { 'bork\nfail', 2 } }, content = { { 'bork\nfail', 9 } },
kind = 'echoerr', kind = 'echoerr',
}, },
}, },
@@ -415,8 +383,8 @@ describe('ui/ext_messages', function()
feed('/line<cr>') feed('/line<cr>')
screen:expect { screen:expect {
grid = [[ grid = [[
{7:^line} 1 | {10:^line} 1 |
{7:line} 2 | {10:line} 2 |
{1:~ }|*3 {1:~ }|*3
]], ]],
messages = { messages = {
@@ -427,8 +395,8 @@ describe('ui/ext_messages', function()
feed('n') feed('n')
screen:expect { screen:expect {
grid = [[ grid = [[
{7:line} 1 | {10:line} 1 |
{7:^line} 2 | {10:^line} 2 |
{1:~ }|*3 {1:~ }|*3
]], ]],
messages = { messages = {
@@ -448,15 +416,15 @@ describe('ui/ext_messages', function()
{ {
content = { content = {
{ '\nErrorMsg ' }, { '\nErrorMsg ' },
{ 'xxx', 2 }, { 'xxx', 9 },
{ ' ' }, { ' ' },
{ 'ctermfg=', 5 }, { 'ctermfg=', 18 },
{ '15 ' }, { '15 ' },
{ 'ctermbg=', 5 }, { 'ctermbg=', 18 },
{ '1 ' }, { '1 ' },
{ 'guifg=', 5 }, { 'guifg=', 18 },
{ 'White ' }, { 'White ' },
{ 'guibg=', 5 }, { 'guibg=', 18 },
{ 'Red' }, { 'Red' },
}, },
kind = '', kind = '',
@@ -476,7 +444,7 @@ describe('ui/ext_messages', function()
messages = { messages = {
{ content = { { 'x #1' } }, kind = '' }, { content = { { 'x #1' } }, kind = '' },
{ content = { { 'y #2' } }, kind = '' }, { content = { { 'y #2' } }, kind = '' },
{ content = { { 'Press ENTER or type command to continue', 4 } }, kind = 'return_prompt' }, { content = { { 'Press ENTER or type command to continue', 6 } }, kind = 'return_prompt' },
}, },
} }
end) end)
@@ -489,7 +457,7 @@ describe('ui/ext_messages', function()
^ | ^ |
{1:~ }|*4 {1:~ }|*4
]], ]],
showmode = { { '-- INSERT --', 3 } }, showmode = { { '-- INSERT --', 5 } },
} }
feed('alphpabet<cr>alphanum<cr>') feed('alphpabet<cr>alphanum<cr>')
@@ -500,7 +468,7 @@ describe('ui/ext_messages', function()
^ | ^ |
{1:~ }|*2 {1:~ }|*2
]], ]],
showmode = { { '-- INSERT --', 3 } }, showmode = { { '-- INSERT --', 5 } },
} }
feed('<c-x>') feed('<c-x>')
@@ -511,7 +479,7 @@ describe('ui/ext_messages', function()
^ | ^ |
{1:~ }|*2 {1:~ }|*2
]], ]],
showmode = { { '-- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)', 3 } }, showmode = { { '-- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)', 5 } },
} }
feed('<c-p>') feed('<c-p>')
@@ -527,7 +495,7 @@ describe('ui/ext_messages', function()
items = { { 'alphpabet', '', '', '' }, { 'alphanum', '', '', '' } }, items = { { 'alphpabet', '', '', '' }, { 'alphanum', '', '', '' } },
pos = 1, pos = 1,
}, },
showmode = { { '-- Keyword Local completion (^N^P) ', 3 }, { 'match 1 of 2', 4 } }, showmode = { { '-- Keyword Local completion (^N^P) ', 5 }, { 'match 1 of 2', 6 } },
} }
-- echomsg and showmode don't overwrite each other, this is the same -- echomsg and showmode don't overwrite each other, this is the same
@@ -549,7 +517,7 @@ describe('ui/ext_messages', function()
content = { { 'stuff' } }, content = { { 'stuff' } },
kind = 'echomsg', kind = 'echomsg',
} }, } },
showmode = { { '-- Keyword Local completion (^N^P) ', 3 }, { 'match 1 of 2', 4 } }, showmode = { { '-- Keyword Local completion (^N^P) ', 5 }, { 'match 1 of 2', 6 } },
} }
feed('<c-p>') feed('<c-p>')
@@ -569,7 +537,7 @@ describe('ui/ext_messages', function()
content = { { 'stuff' } }, content = { { 'stuff' } },
kind = 'echomsg', kind = 'echomsg',
} }, } },
showmode = { { '-- Keyword Local completion (^N^P) ', 3 }, { 'match 2 of 2', 4 } }, showmode = { { '-- Keyword Local completion (^N^P) ', 5 }, { 'match 2 of 2', 6 } },
} }
feed('<esc>:messages<cr>') feed('<esc>:messages<cr>')
@@ -586,7 +554,7 @@ describe('ui/ext_messages', function()
} }, } },
messages = { messages = {
{ {
content = { { 'Press ENTER or type command to continue', 4 } }, content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt', kind = 'return_prompt',
}, },
}, },
@@ -600,7 +568,7 @@ describe('ui/ext_messages', function()
^ | ^ |
{1:~ }|*4 {1:~ }|*4
]], ]],
showmode = { { 'recording @q', 3 } }, showmode = { { 'recording @q', 5 } },
} }
feed('i') feed('i')
@@ -609,7 +577,7 @@ describe('ui/ext_messages', function()
^ | ^ |
{1:~ }|*4 {1:~ }|*4
]], ]],
showmode = { { '-- INSERT --recording @q', 3 } }, showmode = { { '-- INSERT --recording @q', 5 } },
} }
feed('<esc>') feed('<esc>')
@@ -618,7 +586,7 @@ describe('ui/ext_messages', function()
^ | ^ |
{1:~ }|*4 {1:~ }|*4
]], ]],
showmode = { { 'recording @q', 3 } }, showmode = { { 'recording @q', 5 } },
} }
feed('q') feed('q')
@@ -637,7 +605,7 @@ describe('ui/ext_messages', function()
^ | ^ |
{1:~ }|*4 {1:~ }|*4
]], ]],
showmode = { { 'recording @q', 3 } }, showmode = { { 'recording @q', 5 } },
mode = 'normal', mode = 'normal',
} }
@@ -647,7 +615,7 @@ describe('ui/ext_messages', function()
^ | ^ |
{1:~ }|*4 {1:~ }|*4
]], ]],
showmode = { { 'recording @q', 3 } }, showmode = { { 'recording @q', 5 } },
mode = 'insert', mode = 'insert',
} }
@@ -657,7 +625,7 @@ describe('ui/ext_messages', function()
^ | ^ |
{1:~ }|*4 {1:~ }|*4
]], ]],
showmode = { { 'recording @q', 3 } }, showmode = { { 'recording @q', 5 } },
mode = 'normal', mode = 'normal',
} }
@@ -686,7 +654,7 @@ describe('ui/ext_messages', function()
^ | ^ |
{1:~ }|*4 {1:~ }|*4
]], ]],
showmode = { { '-- INSERT --', 3 } }, showmode = { { '-- INSERT --', 5 } },
ruler = { { '0,1 All' } }, ruler = { { '0,1 All' } },
} }
feed('abcde<cr>12345<esc>') feed('abcde<cr>12345<esc>')
@@ -754,7 +722,7 @@ describe('ui/ext_messages', function()
abcde | abcde |
^ | ^ |
{1:~ }|*2 {1:~ }|*2
{6:<o Name] [+] 2,0-1 All}| {3:<o Name] [+] 2,0-1 All}|
]]) ]])
end) end)
@@ -794,7 +762,7 @@ describe('ui/ext_messages', function()
{1:~ }|*4 {1:~ }|*4
]], ]],
messages = { { messages = { {
content = { { 'bork', 2 } }, content = { { 'bork', 9 } },
kind = 'echoerr', kind = 'echoerr',
} }, } },
} }
@@ -819,7 +787,7 @@ describe('ui/ext_messages', function()
]], ]],
messages = { messages = {
{ {
content = { { 'E117: Unknown function: nosuchfunction', 2 } }, content = { { 'E117: Unknown function: nosuchfunction', 9 } },
kind = 'emsg', kind = 'emsg',
}, },
}, },
@@ -834,12 +802,12 @@ describe('ui/ext_messages', function()
msg_history = { msg_history = {
{ kind = 'echomsg', content = { { 'howdy' } } }, { kind = 'echomsg', content = { { 'howdy' } } },
{ kind = '', content = { { 'Type :qa and press <Enter> to exit Nvim' } } }, { kind = '', content = { { 'Type :qa and press <Enter> to exit Nvim' } } },
{ kind = 'echoerr', content = { { 'bork', 2 } } }, { kind = 'echoerr', content = { { 'bork', 9 } } },
{ kind = 'emsg', content = { { 'E117: Unknown function: nosuchfunction', 2 } } }, { kind = 'emsg', content = { { 'E117: Unknown function: nosuchfunction', 9 } } },
}, },
messages = { messages = {
{ {
content = { { 'Press ENTER or type command to continue', 4 } }, content = { { 'Press ENTER or type command to continue', 6 } },
kind = 'return_prompt', kind = 'return_prompt',
}, },
}, },
@@ -911,7 +879,7 @@ error
stack traceback: stack traceback:
[C]: in function 'error' [C]: in function 'error'
[string ":lua"]:1: in main chunk]], [string ":lua"]:1: in main chunk]],
2, 9,
}, },
}, },
kind = 'lua_error', kind = 'lua_error',
@@ -931,7 +899,7 @@ stack traceback:
messages = { messages = {
{ {
content = { content = {
{ "Error invoking 'test_method' on channel 1:\ncomplete\nerror\n\nmessage", 2 }, { "Error invoking 'test_method' on channel 1:\ncomplete\nerror\n\nmessage", 9 },
}, },
kind = 'rpc_error', kind = 'rpc_error',
}, },
@@ -956,7 +924,7 @@ stack traceback:
{ {
content = { content = {
{ '\nn Q @@\nn Y y$\nn j ' }, { '\nn Q @@\nn Y y$\nn j ' },
{ '*', 5 }, { '*', 18 },
{ ' k' }, { ' k' },
}, },
kind = '', kind = '',
@@ -997,7 +965,7 @@ stack traceback:
feed('z=') feed('z=')
screen:expect { screen:expect {
grid = [[ grid = [[
{9:helllo} | {100:helllo} |
{1:~ }|*3 {1:~ }|*3
{1:^~ }| {1:^~ }|
]], ]],
@@ -1016,7 +984,7 @@ stack traceback:
feed('1') feed('1')
screen:expect { screen:expect {
grid = [[ grid = [[
{9:helllo} | {100:helllo} |
{1:~ }|*3 {1:~ }|*3
{1:^~ }| {1:^~ }|
]], ]],
@@ -1054,7 +1022,7 @@ stack traceback:
{1:~ }|*4 {1:~ }|*4
]], ]],
messages = { messages = {
{ content = { { 'wow, ', 7 }, { 'such\n\nvery ', 2 }, { 'color', 10 } }, kind = 'echomsg' }, { content = { { 'wow, ', 10 }, { 'such\n\nvery ', 9 }, { 'color', 8 } }, kind = 'echomsg' },
}, },
} }
@@ -1076,10 +1044,10 @@ stack traceback:
{1:~ }|*4 {1:~ }|*4
]], ]],
messages = { messages = {
{ content = { { 'Press ENTER or type command to continue', 4 } }, kind = 'return_prompt' }, { content = { { 'Press ENTER or type command to continue', 6 } }, kind = 'return_prompt' },
}, },
msg_history = { msg_history = {
{ content = { { 'wow, ', 7 }, { 'such\n\nvery ', 2 }, { 'color', 10 } }, kind = 'echomsg' }, { content = { { 'wow, ', 10 }, { 'such\n\nvery ', 9 }, { 'color', 8 } }, kind = 'echomsg' },
}, },
} }
@@ -1108,18 +1076,10 @@ describe('ui/builtin messages', function()
clear() clear()
screen = Screen.new(60, 7) screen = Screen.new(60, 7)
screen:attach({ rgb = true, ext_popupmenu = true }) screen:attach({ rgb = true, ext_popupmenu = true })
screen:set_default_attr_ids { screen:add_extra_attr_ids {
[1] = { bold = true, foreground = Screen.colors.Blue1 }, [100] = { background = Screen.colors.LightRed },
[2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red }, [101] = { background = Screen.colors.Grey20 },
[3] = { bold = true, reverse = true }, [102] = { foreground = Screen.colors.Magenta1, bold = true },
[4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
[5] = { foreground = Screen.colors.Blue1 },
[6] = { bold = true, foreground = Screen.colors.Magenta },
[7] = { background = Screen.colors.Grey20 },
[8] = { reverse = true },
[9] = { background = Screen.colors.LightRed },
[10] = { background = Screen.colors.Yellow },
[11] = { foreground = Screen.colors.Brown },
} }
end) end)
@@ -1129,12 +1089,12 @@ describe('ui/builtin messages', function()
screen:expect { screen:expect {
grid = [[ grid = [[
{3: }| {3: }|
{2:Error invoking 'test_method' on channel 1:} | {9:Error invoking 'test_method' on channel 1:} |
{2:complete} | {9:complete} |
{2:error} | {9:error} |
| |
{2:message} | {9:message} |
{4:Press ENTER or type command to continue}^ | {6:Press ENTER or type command to continue}^ |
]], ]],
request_cb = function(name) request_cb = function(name)
if name == 'test_method' then if name == 'test_method' then
@@ -1152,8 +1112,8 @@ describe('ui/builtin messages', function()
{1:~ }|*2 {1:~ }|*2
{3: }| {3: }|
:hi ErrorMsg | :hi ErrorMsg |
ErrorMsg {2:xxx} {5:ctermfg=}15 {5:ctermbg=}1 {5:guifg=}White {5:guibg=}Red | ErrorMsg {9:xxx} {18:ctermfg=}15 {18:ctermbg=}1 {18:guifg=}White {18:guibg=}Red |
{4:Press ENTER or type command to continue}^ | {6:Press ENTER or type command to continue}^ |
]]) ]])
feed('<cr>') feed('<cr>')
@@ -1161,12 +1121,12 @@ describe('ui/builtin messages', function()
feed(':hi ErrorMsg<cr>') feed(':hi ErrorMsg<cr>')
screen:expect([[ screen:expect([[
:hi ErrorMsg | :hi ErrorMsg |
ErrorMsg {2:xxx} {5:ctermfg=}15 | ErrorMsg {9:xxx} {18:ctermfg=}15 |
{5:ctermbg=}1 | {18:ctermbg=}1 |
{5:guifg=}White| {18:guifg=}White|
{5:guibg=}Red | {18:guibg=}Red |
{4:Press ENTER or type command to}| {6:Press ENTER or type command to}|
{4: continue}^ | {6: continue}^ |
]]) ]])
feed('<cr>') feed('<cr>')
@@ -1180,13 +1140,13 @@ describe('ui/builtin messages', function()
screen:try_resize(110, 7) screen:try_resize(110, 7)
feed(':syntax list vimComment<cr>') feed(':syntax list vimComment<cr>')
screen:expect([[ screen:expect([[
{6:--- Syntax items ---} | {102:--- Syntax items ---} |
vimComment {5:xxx} {5:match} /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 {5:excludenl} {5:contains}=@vimCommentGroup,vimCommentString | vimComment {18:xxx} {18:match} /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 {18:excludenl} {18:contains}=@vimCommentGroup,vimCommentString |
| |
{5:match} /\<endif\s\+".*$/ms=s+5,lc=5 {5:contains}=@vimCommentGroup,vimCommentString | {18:match} /\<endif\s\+".*$/ms=s+5,lc=5 {18:contains}=@vimCommentGroup,vimCommentString |
{5:match} /\<else\s\+".*$/ms=s+4,lc=4 {5:contains}=@vimCommentGroup,vimCommentString | {18:match} /\<else\s\+".*$/ms=s+4,lc=4 {18:contains}=@vimCommentGroup,vimCommentString |
{5:links to} Comment | {18:links to} Comment |
{4:Press ENTER or type command to continue}^ | {6:Press ENTER or type command to continue}^ |
]]) ]])
feed('<cr>') feed('<cr>')
@@ -1194,12 +1154,12 @@ describe('ui/builtin messages', function()
feed(':syntax list vimComment<cr>') feed(':syntax list vimComment<cr>')
screen:expect([[ screen:expect([[
| |
{5:match} /\<endif\s\+".*$/ms=s+5,lc=5 | {18:match} /\<endif\s\+".*$/ms=s+5,lc=5 |
{5:contains}=@vimCommentGroup,vimCommentString | {18:contains}=@vimCommentGroup,vimCommentString |
{5:match} /\<else\s\+".*$/ms=s+4,lc=4 {5:c}| {18:match} /\<else\s\+".*$/ms=s+4,lc=4 {18:c}|
{5:ontains}=@vimCommentGroup,vimCommentString | {18:ontains}=@vimCommentGroup,vimCommentString |
{5:links to} Comment | {18:links to} Comment |
{4:Press ENTER or type command to continue}^ | {6:Press ENTER or type command to continue}^ |
]]) ]])
feed('<cr>') feed('<cr>')
@@ -1272,7 +1232,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
grid = [[ grid = [[
^ | ^ |
{1:~ }|*5 {1:~ }|*5
{7: 0,0-1 All }| {101: 0,0-1 All }|
]], ]],
} }
@@ -1281,7 +1241,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
grid = [[ grid = [[
^ | ^ |
{1:~ }|*5 {1:~ }|*5
{7: 0,0-1 100% }| {101: 0,0-1 100% }|
]], ]],
} }
end) end)
@@ -1295,7 +1255,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
{3: }| {3: }|
line 1 | line 1 |
line 2 | line 2 |
{4:Press ENTER or type command to continue}^ | {6:Press ENTER or type command to continue}^ |
]], ]],
} }
@@ -1319,7 +1279,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
grid = [[ grid = [[
| |
{1:~ }| {1:~ }|
{8:[No Name] }| {2:[No Name] }|
^ | ^ |
{1:~ }| {1:~ }|
{3:[No Name] }| {3:[No Name] }|
@@ -1331,12 +1291,12 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
screen:expect { screen:expect {
grid = [[ grid = [[
:set colorcolumn=10 | digraphs | :set colorcolumn=10 | digraphs |
NU {5:^@} 10 SH {5:^A} 1 SX {5:^B} 2 EX {5:^C} 3 | NU {18:^@} 10 SH {18:^A} 1 SX {18:^B} 2 EX {18:^C} 3 |
ET {5:^D} 4 EQ {5:^E} 5 AK {5:^F} 6 BL {5:^G} 7 | ET {18:^D} 4 EQ {18:^E} 5 AK {18:^F} 6 BL {18:^G} 7 |
BS {5:^H} 8 HT {5:^I} 9 LF {5:^@} 10 VT {5:^K} 11 | BS {18:^H} 8 HT {18:^I} 9 LF {18:^@} 10 VT {18:^K} 11 |
FF {5:^L} 12 CR {5:^M} 13 SO {5:^N} 14 SI {5:^O} 15 | FF {18:^L} 12 CR {18:^M} 13 SO {18:^N} 14 SI {18:^O} 15 |
DL {5:^P} 16 D1 {5:^Q} 17 D2 {5:^R} 18 D3 {5:^S} 19 | DL {18:^P} 16 D1 {18:^Q} 17 D2 {18:^R} 18 D3 {18:^S} 19 |
{4:-- More --}^ | {6:-- More --}^ |
]], ]],
} }
@@ -1345,8 +1305,8 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
grid = [[ grid = [[
| |
{1:~ }| {1:~ }|
{8:[No Name] }| {2:[No Name] }|
^ {9: } | ^ {100: } |
{1:~ }| {1:~ }|
{3:[No Name] }| {3:[No Name] }|
| |
@@ -1357,13 +1317,13 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
feed(':set colorcolumn=5 | lua error("x\\n\\nx")<cr>') feed(':set colorcolumn=5 | lua error("x\\n\\nx")<cr>')
screen:expect { screen:expect {
grid = [[ grid = [[
{2:E5108: Error executing lua [string ":lua"]:1: x} | {9:E5108: Error executing lua [string ":lua"]:1: x} |
| |
{2:x} | {9:x} |
{2:stack traceback:} | {9:stack traceback:} |
{2: [C]: in function 'error'} | {9: [C]: in function 'error'} |
{2: [string ":lua"]:1: in main chunk} | {9: [string ":lua"]:1: in main chunk} |
{4:Press ENTER or type command to continue}^ | {6:Press ENTER or type command to continue}^ |
]], ]],
} }
@@ -1372,8 +1332,8 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
grid = [[ grid = [[
| |
{1:~ }| {1:~ }|
{8:[No Name] }| {2:[No Name] }|
^ {9: } | ^ {100: } |
{1:~ }| {1:~ }|
{3:[No Name] }| {3:[No Name] }|
| |
@@ -1384,12 +1344,12 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
feed(':set colorcolumn=5 | lua error("x\\n\\n\\nx")<cr>') feed(':set colorcolumn=5 | lua error("x\\n\\n\\nx")<cr>')
screen:expect { screen:expect {
grid = [[ grid = [[
{2:E5108: Error executing lua [string ":lua"]:1: x} | {9:E5108: Error executing lua [string ":lua"]:1: x} |
|*2 |*2
{2:x} | {9:x} |
{2:stack traceback:} | {9:stack traceback:} |
{2: [C]: in function 'error'} | {9: [C]: in function 'error'} |
{4:-- More --}^ | {6:-- More --}^ |
]], ]],
} }
@@ -1397,11 +1357,11 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
screen:expect { screen:expect {
grid = [[ grid = [[
|*2 |*2
{2:x} | {9:x} |
{2:stack traceback:} | {9:stack traceback:} |
{2: [C]: in function 'error'} | {9: [C]: in function 'error'} |
{2: [string ":lua"]:1: in main chunk} | {9: [string ":lua"]:1: in main chunk} |
{4:Press ENTER or type command to continue}^ | {6:Press ENTER or type command to continue}^ |
]], ]],
} }
end) end)
@@ -1417,10 +1377,10 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
| |
{1:~ }| {1:~ }|
{3: }| {3: }|
{10:wow, }{2:such} | {10:wow, }{9:such} |
| |
{2:very }{11:color} | {9:very }{8:color} |
{4:Press ENTER or type command to continue}^ | {6:Press ENTER or type command to continue}^ |
]], ]],
} }
@@ -1439,10 +1399,10 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
| |
{1:~ }| {1:~ }|
{3: }| {3: }|
{10:wow, }{2:such} | {10:wow, }{9:such} |
| |
{2:very }{11:color} | {9:very }{8:color} |
{4:Press ENTER or type command to continue}^ | {6:Press ENTER or type command to continue}^ |
]], ]],
} }
end) end)
@@ -1453,19 +1413,19 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
feed('gggQ<CR><CR>1<CR><CR>vi') feed('gggQ<CR><CR>1<CR><CR>vi')
screen:expect([[ screen:expect([[
Entering Ex mode. Type "visual" to go to Normal mode. | Entering Ex mode. Type "visual" to go to Normal mode. |
{11: 2 }bbb | {8: 2 }bbb |
{11: 3 }ccc | {8: 3 }ccc |
:1 | :1 |
{11: 1 }aaa | {8: 1 }aaa |
{11: 2 }bbb | {8: 2 }bbb |
:vi^ | :vi^ |
]]) ]])
feed('<CR>') feed('<CR>')
screen:expect([[ screen:expect([[
{11: 1 }aaa | {8: 1 }aaa |
{11: 2 }^bbb | {8: 2 }^bbb |
{11: 3 }ccc | {8: 3 }ccc |
{11: 4 } | {8: 4 } |
{1:~ }|*2 {1:~ }|*2
| |
]]) ]])
@@ -1506,7 +1466,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
aaa | aaa |
bbb | bbb |
ccc | ccc |
{4:Press ENTER or type command to continue}^ | {6:Press ENTER or type command to continue}^ |
]], ]],
} }
end end
@@ -1538,7 +1498,7 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
{1:~ }|*3 {1:~ }|*3
{3: }| {3: }|
| |
{4:Press ENTER or type command to continue}^ | {6:Press ENTER or type command to continue}^ |
]]) ]])
feed('<CR>') feed('<CR>')
screen:expect([[ screen:expect([[
@@ -1596,16 +1556,6 @@ describe('ui/ext_messages', function()
clear { args_rm = { '--headless' }, args = { '--cmd', 'set shortmess-=I' } } clear { args_rm = { '--headless' }, args = { '--cmd', 'set shortmess-=I' } }
screen = Screen.new(80, 24) screen = Screen.new(80, 24)
screen:attach({ rgb = true, ext_messages = true, ext_popupmenu = true }) screen:attach({ rgb = true, ext_messages = true, ext_popupmenu = true })
screen:set_default_attr_ids({
[1] = { bold = true, foreground = Screen.colors.Blue1 },
[2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
[3] = { bold = true },
[4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
[5] = { foreground = Screen.colors.Blue1 },
[6] = { reverse = true },
[7] = { bold = true, reverse = true },
[8] = { background = Screen.colors.Plum1 },
})
end) end)
it('supports intro screen', function() it('supports intro screen', function()
@@ -1619,18 +1569,18 @@ describe('ui/ext_messages', function()
{1:~ }Nvim is open source and freely distributable{1: }| {1:~ }Nvim is open source and freely distributable{1: }|
{1:~ }https://neovim.io/#chat{1: }| {1:~ }https://neovim.io/#chat{1: }|
{1:~ }| {1:~ }|
{1:~ }type :help nvim{5:<Enter>} if you are new! {1: }| {1:~ }type :help nvim{18:<Enter>} if you are new! {1: }|
{1:~ }type :checkhealth{5:<Enter>} to optimize Nvim{1: }| {1:~ }type :checkhealth{18:<Enter>} to optimize Nvim{1: }|
{1:~ }type :q{5:<Enter>} to exit {1: }| {1:~ }type :q{18:<Enter>} to exit {1: }|
{1:~ }type :help{5:<Enter>} for help {1: }| {1:~ }type :help{18:<Enter>} for help {1: }|
{1:~ }| {1:~ }|
{1:~{MATCH: +}}type :help news{5:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}| {1:~{MATCH: +}}type :help news{18:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}|
{1:~ }| {1:~ }|
{1:~ }Help poor children in Uganda!{1: }| {1:~ }Help poor children in Uganda!{1: }|
{1:~ }type :help iccf{5:<Enter>} for information {1: }| {1:~ }type :help iccf{18:<Enter>} for information {1: }|
{1:~ }|*5 {1:~ }|*5
]] ]]
local showmode = { { '-- INSERT --', 3 } } local showmode = { { '-- INSERT --', 5 } }
screen:expect(introscreen) screen:expect(introscreen)
-- <c-l> (same as :mode) does _not_ clear intro message -- <c-l> (same as :mode) does _not_ clear intro message
@@ -1648,22 +1598,22 @@ describe('ui/ext_messages', function()
screen:expect { screen:expect {
grid = [[ grid = [[
^ | ^ |
{1:~ }{8: }{1: }| {1:~ }{4: }{1: }|
{1:~ }|*3 {1:~ }|*3
{MATCH:.*}| {MATCH:.*}|
{1:~ }| {1:~ }|
{1:~ }Nvim is open source and freely distributable{1: }| {1:~ }Nvim is open source and freely distributable{1: }|
{1:~ }https://neovim.io/#chat{1: }| {1:~ }https://neovim.io/#chat{1: }|
{1:~ }| {1:~ }|
{1:~ }type :help nvim{5:<Enter>} if you are new! {1: }| {1:~ }type :help nvim{18:<Enter>} if you are new! {1: }|
{1:~ }type :checkhealth{5:<Enter>} to optimize Nvim{1: }| {1:~ }type :checkhealth{18:<Enter>} to optimize Nvim{1: }|
{1:~ }type :q{5:<Enter>} to exit {1: }| {1:~ }type :q{18:<Enter>} to exit {1: }|
{1:~ }type :help{5:<Enter>} for help {1: }| {1:~ }type :help{18:<Enter>} for help {1: }|
{1:~ }| {1:~ }|
{1:~{MATCH: +}}type :help news{5:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}| {1:~{MATCH: +}}type :help news{18:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}|
{1:~ }| {1:~ }|
{1:~ }Help poor children in Uganda!{1: }| {1:~ }Help poor children in Uganda!{1: }|
{1:~ }type :help iccf{5:<Enter>} for information {1: }| {1:~ }type :help iccf{18:<Enter>} for information {1: }|
{1:~ }|*5 {1:~ }|*5
]], ]],
showmode = showmode, showmode = showmode,
@@ -1692,19 +1642,19 @@ describe('ui/ext_messages', function()
Nvim is open source and freely distributable | Nvim is open source and freely distributable |
https://neovim.io/#chat | https://neovim.io/#chat |
| |
type :help nvim{5:<Enter>} if you are new! | type :help nvim{18:<Enter>} if you are new! |
type :checkhealth{5:<Enter>} to optimize Nvim | type :checkhealth{18:<Enter>} to optimize Nvim |
type :q{5:<Enter>} to exit | type :q{18:<Enter>} to exit |
type :help{5:<Enter>} for help | type :help{18:<Enter>} for help |
| |
{MATCH: +}type :help news{5:<Enter>} to see changes in v{MATCH:%d+%.%d+ +}| {MATCH: +}type :help news{18:<Enter>} to see changes in v{MATCH:%d+%.%d+ +}|
| |
Help poor children in Uganda! | Help poor children in Uganda! |
type :help iccf{5:<Enter>} for information | type :help iccf{18:<Enter>} for information |
|*5 |*5
]], ]],
messages = { messages = {
{ content = { { 'Press ENTER or type command to continue', 4 } }, kind = 'return_prompt' }, { content = { { 'Press ENTER or type command to continue', 6 } }, kind = 'return_prompt' },
}, },
} }
@@ -1733,7 +1683,7 @@ describe('ui/ext_messages', function()
screen:expect { screen:expect {
grid = [[ grid = [[
| |
{1:~ }{8:^ }{1: }| {1:~ }{4:^ }{1: }|
{1:~ }|*22 {1:~ }|*22
]], ]],
} }
@@ -1745,7 +1695,7 @@ describe('ui/ext_messages', function()
screen:expect { screen:expect {
grid = [[ grid = [[
| |
{1:~ }{8:^ }{1: }| {1:~ }{4:^ }{1: }|
{1:~ }|*22 {1:~ }|*22
]], ]],
} }
@@ -1762,9 +1712,9 @@ describe('ui/ext_messages', function()
screen:expect { screen:expect {
grid = [[ grid = [[
| |
{1:~ }{8:^ }{1: }| {1:~ }{4:^ }{1: }|
{1:~ }|*21 {1:~ }|*21
{6:[No Name] }| {2:[No Name] }|
]], ]],
} }
end) end)
@@ -1780,7 +1730,7 @@ describe('ui/ext_messages', function()
────────────────────────────────────────────────────────────────────────────────| ────────────────────────────────────────────────────────────────────────────────|
| |
{1:~ }|*10 {1:~ }|*10
{7:[No Name] }| {3:[No Name] }|
]], ]],
messages = { messages = {
{ content = { { ' cmdheight=0' } }, kind = '' }, { content = { { ' cmdheight=0' } }, kind = '' },
@@ -1796,7 +1746,7 @@ describe('ui/ext_messages', function()
────────────────────────────────────────────────────────────────────────────────| ────────────────────────────────────────────────────────────────────────────────|
| |
{1:~ }|*9 {1:~ }|*9
{7:[No Name] }| {3:[No Name] }|
]], ]],
messages = { messages = {
{ content = { { ' laststatus=3' } }, kind = '' }, { content = { { ' laststatus=3' } }, kind = '' },
@@ -1816,7 +1766,7 @@ describe('ui/ext_messages', function()
────────────────────────────────────────────────────────────────────────────────| ────────────────────────────────────────────────────────────────────────────────|
| |
{1:~ }|*10 {1:~ }|*10
{7:[No Name] }| {3:[No Name] }|
]], ]],
messages = { messages = {
{ content = { { ' cmdheight=0' } }, kind = '' }, { content = { { ' cmdheight=0' } }, kind = '' },
@@ -1829,13 +1779,6 @@ it('ui/ext_multigrid supports intro screen', function()
clear { args_rm = { '--headless' }, args = { '--cmd', 'set shortmess-=I' } } clear { args_rm = { '--headless' }, args = { '--cmd', 'set shortmess-=I' } }
local screen = Screen.new(80, 24) local screen = Screen.new(80, 24)
screen:attach({ rgb = true, ext_multigrid = true }) screen:attach({ rgb = true, ext_multigrid = true })
screen:set_default_attr_ids {
[1] = { bold = true, foreground = Screen.colors.Blue1 },
[2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
[3] = { bold = true },
[4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
[5] = { foreground = Screen.colors.Blue1 },
}
screen:expect { screen:expect {
grid = [[ grid = [[
@@ -1850,15 +1793,15 @@ it('ui/ext_multigrid supports intro screen', function()
{1:~ }Nvim is open source and freely distributable{1: }| {1:~ }Nvim is open source and freely distributable{1: }|
{1:~ }https://neovim.io/#chat{1: }| {1:~ }https://neovim.io/#chat{1: }|
{1:~ }| {1:~ }|
{1:~ }type :help nvim{5:<Enter>} if you are new! {1: }| {1:~ }type :help nvim{18:<Enter>} if you are new! {1: }|
{1:~ }type :checkhealth{5:<Enter>} to optimize Nvim{1: }| {1:~ }type :checkhealth{18:<Enter>} to optimize Nvim{1: }|
{1:~ }type :q{5:<Enter>} to exit {1: }| {1:~ }type :q{18:<Enter>} to exit {1: }|
{1:~ }type :help{5:<Enter>} for help {1: }| {1:~ }type :help{18:<Enter>} for help {1: }|
{1:~ }| {1:~ }|
{1:~{MATCH: +}}type :help news{5:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}| {1:~{MATCH: +}}type :help news{18:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}|
{1:~ }| {1:~ }|
{1:~ }Help poor children in Uganda!{1: }| {1:~ }Help poor children in Uganda!{1: }|
{1:~ }type :help iccf{5:<Enter>} for information {1: }| {1:~ }type :help iccf{18:<Enter>} for information {1: }|
{1:~ }|*4 {1:~ }|*4
## grid 3 ## grid 3
| |
@@ -1886,7 +1829,7 @@ it('ui/ext_multigrid supports intro screen', function()
x^ | x^ |
{1:~ }|*22 {1:~ }|*22
## grid 3 ## grid 3
{3:-- INSERT --} | {5:-- INSERT --} |
]], ]],
win_viewport = { win_viewport = {
[2] = { [2] = {