2024-04-09 04:26:16 -07:00
|
|
|
|
local t = require('test.functional.testutil')()
|
2017-10-31 08:46:02 -07:00
|
|
|
|
local Screen = require('test.functional.ui.screen')
|
2024-04-08 02:03:20 -07:00
|
|
|
|
local clear, feed = t.clear, t.feed
|
|
|
|
|
local eval = t.eval
|
|
|
|
|
local eq = t.eq
|
|
|
|
|
local neq = t.neq
|
|
|
|
|
local command = t.command
|
|
|
|
|
local set_method_error = t.set_method_error
|
|
|
|
|
local api = t.api
|
|
|
|
|
local async_meths = t.async_meths
|
|
|
|
|
local test_build_dir = t.paths.test_build_dir
|
|
|
|
|
local nvim_prog = t.nvim_prog
|
|
|
|
|
local testprg = t.testprg
|
|
|
|
|
local exec = t.exec
|
|
|
|
|
local exec_capture = t.exec_capture
|
|
|
|
|
local exc_exec = t.exc_exec
|
|
|
|
|
local exec_lua = t.exec_lua
|
|
|
|
|
local poke_eventloop = t.poke_eventloop
|
|
|
|
|
local assert_alive = t.assert_alive
|
|
|
|
|
local retry = t.retry
|
|
|
|
|
local is_os = t.is_os
|
|
|
|
|
local fn = t.fn
|
|
|
|
|
local skip = t.skip
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
describe('ui/ext_messages', function()
|
|
|
|
|
local screen
|
2023-04-11 02:18:54 -07:00
|
|
|
|
local fname = 'Xtest_functional_ui_messages_spec'
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
before_each(function()
|
|
|
|
|
clear()
|
|
|
|
|
screen = Screen.new(25, 5)
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:attach({ rgb = true, ext_messages = true, ext_popupmenu = true })
|
2024-04-04 02:26:39 -07:00
|
|
|
|
screen:add_extra_attr_ids {
|
|
|
|
|
[100] = { undercurl = true, special = Screen.colors.Red },
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
end)
|
2019-05-09 14:54:04 -07:00
|
|
|
|
after_each(function()
|
2023-04-11 02:18:54 -07:00
|
|
|
|
os.remove(fname)
|
2019-05-09 14:54:04 -07:00
|
|
|
|
end)
|
|
|
|
|
|
2019-06-02 14:38:19 -07:00
|
|
|
|
it('msg_clear follows msg_show kind of confirm', function()
|
|
|
|
|
feed('iline 1<esc>')
|
|
|
|
|
feed(':call confirm("test")<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-06-02 14:38:19 -07:00
|
|
|
|
line ^1 |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { '\ntest\n[O]k: ', 6 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'confirm',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2019-06-02 14:38:19 -07:00
|
|
|
|
|
|
|
|
|
feed('<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-06-02 14:38:19 -07:00
|
|
|
|
line ^1 |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-06-02 14:38:19 -07:00
|
|
|
|
end)
|
|
|
|
|
|
2019-05-26 15:01:41 -07:00
|
|
|
|
it('msg_show kind=confirm,confirm_sub,emsg,wmsg,quickfix', function()
|
2019-05-09 14:54:04 -07:00
|
|
|
|
feed('iline 1\nline 2<esc>')
|
|
|
|
|
|
|
|
|
|
-- kind=confirm
|
|
|
|
|
feed(':echo confirm("test")<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-05-09 14:54:04 -07:00
|
|
|
|
line 1 |
|
|
|
|
|
line ^2 |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { '\ntest\n[O]k: ', 6 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'confirm',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2019-05-09 14:54:04 -07:00
|
|
|
|
feed('<cr><cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-05-09 14:54:04 -07:00
|
|
|
|
line 1 |
|
|
|
|
|
line ^2 |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { '\ntest\n[O]k: ', 6 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'confirm',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
content = { { '1' } },
|
|
|
|
|
kind = 'echo',
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'Press ENTER or type command to continue', 6 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'return_prompt',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2019-05-09 14:54:04 -07:00
|
|
|
|
feed('<cr><cr>')
|
|
|
|
|
|
|
|
|
|
-- kind=confirm_sub
|
|
|
|
|
feed(':%s/i/X/gc<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2024-04-04 02:26:39 -07:00
|
|
|
|
l{2:i}ne 1 |
|
|
|
|
|
l{10:i}ne ^2 |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'replace with X (y/n/a/q/l/^E/^Y)?', 6 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'confirm_sub',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2019-05-09 14:54:04 -07:00
|
|
|
|
feed('nq')
|
|
|
|
|
|
|
|
|
|
-- kind=wmsg (editing readonly file)
|
2023-04-11 02:18:54 -07:00
|
|
|
|
command('write ' .. fname)
|
2019-05-09 14:54:04 -07:00
|
|
|
|
command('set readonly nohls')
|
|
|
|
|
feed('G$x')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-05-09 14:54:04 -07:00
|
|
|
|
line 1 |
|
2024-04-04 02:26:39 -07:00
|
|
|
|
line ^2 |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'W10: Warning: Changing a readonly file', 19 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'wmsg',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2019-05-09 14:54:04 -07:00
|
|
|
|
|
|
|
|
|
-- kind=wmsg ('wrapscan' after search reaches EOF)
|
|
|
|
|
feed('uG$/i<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-05-09 14:54:04 -07:00
|
|
|
|
l^ine 1 |
|
|
|
|
|
line 2 |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'search hit BOTTOM, continuing at TOP', 19 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'wmsg',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2019-05-09 14:54:04 -07:00
|
|
|
|
|
|
|
|
|
-- kind=emsg after :throw
|
|
|
|
|
feed(':throw "foo"<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-05-09 14:54:04 -07:00
|
|
|
|
l^ine 1 |
|
|
|
|
|
line 2 |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'Error detected while processing :', 9 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'emsg',
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'E605: Exception not caught: foo', 9 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = '',
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'Press ENTER or type command to continue', 6 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'return_prompt',
|
|
|
|
|
},
|
|
|
|
|
},
|
2019-05-09 14:54:04 -07:00
|
|
|
|
}
|
2019-05-26 15:01:41 -07:00
|
|
|
|
|
|
|
|
|
-- kind=quickfix after :cnext
|
|
|
|
|
feed('<c-c>')
|
|
|
|
|
command("caddexpr [expand('%').':1:line1',expand('%').':2:line2']")
|
|
|
|
|
feed(':cnext<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-05-26 15:01:41 -07:00
|
|
|
|
line 1 |
|
|
|
|
|
^line 2 |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
|
|
|
|
content = { { '(2 of 2): line2' } },
|
|
|
|
|
kind = 'quickfix',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2019-05-09 14:54:04 -07:00
|
|
|
|
end)
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
2019-05-09 14:54:04 -07:00
|
|
|
|
it(':echoerr', function()
|
2017-10-31 08:46:02 -07:00
|
|
|
|
feed(':echoerr "raa"<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = { {
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'raa', 9 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'echoerr',
|
|
|
|
|
} },
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
-- cmdline in a later input cycle clears error message
|
|
|
|
|
feed(':')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
cmdline = { {
|
|
|
|
|
firstc = ':',
|
|
|
|
|
content = { { '' } },
|
|
|
|
|
pos = 0,
|
|
|
|
|
} },
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
feed('echoerr "bork" | echoerr "fail"<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'bork', 9 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'echoerr',
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'fail', 9 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'echoerr',
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'Press ENTER or type command to continue', 6 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'return_prompt',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
feed(':echoerr "extrafail"<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'bork', 9 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'echoerr',
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'fail', 9 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'echoerr',
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'extrafail', 9 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'echoerr',
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'Press ENTER or type command to continue', 6 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'return_prompt',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
feed('<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
-- cmdline without interleaving wait/display keeps the error message
|
|
|
|
|
feed(':echoerr "problem" | let x = input("foo> ")<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = { {
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'problem', 9 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'echoerr',
|
|
|
|
|
} },
|
|
|
|
|
cmdline = {
|
|
|
|
|
{
|
|
|
|
|
prompt = 'foo> ',
|
|
|
|
|
content = { { '' } },
|
|
|
|
|
pos = 0,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
feed('solution<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
eq('solution', eval('x'))
|
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
feed(':messages<cr>')
|
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
msg_history = {
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{ kind = 'echoerr', content = { { 'raa', 9 } } },
|
|
|
|
|
{ kind = 'echoerr', content = { { 'bork', 9 } } },
|
|
|
|
|
{ kind = 'echoerr', content = { { 'fail', 9 } } },
|
|
|
|
|
{ kind = 'echoerr', content = { { 'extrafail', 9 } } },
|
|
|
|
|
{ kind = 'echoerr', content = { { 'problem', 9 } } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
},
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'Press ENTER or type command to continue', 6 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'return_prompt',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2021-01-20 02:25:52 -07:00
|
|
|
|
|
|
|
|
|
feed '<cr>'
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2021-01-20 02:25:52 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
end)
|
|
|
|
|
|
2023-10-12 16:27:45 -07:00
|
|
|
|
it(':echoerr multiline', function()
|
|
|
|
|
exec_lua([[vim.g.multi = table.concat({ "bork", "fail" }, "\n")]])
|
|
|
|
|
feed(':echoerr g:multi<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2023-10-12 16:27:45 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = { {
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'bork\nfail', 9 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'echoerr',
|
|
|
|
|
} },
|
|
|
|
|
}
|
2023-10-12 16:27:45 -07:00
|
|
|
|
|
|
|
|
|
feed(':messages<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2023-10-12 16:27:45 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'Press ENTER or type command to continue', 6 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'return_prompt',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
msg_history = {
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'bork\nfail', 9 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'echoerr',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2023-10-12 16:27:45 -07:00
|
|
|
|
end)
|
|
|
|
|
|
2019-06-08 04:42:21 -07:00
|
|
|
|
it('shortmess-=S', function()
|
|
|
|
|
command('set shortmess-=S')
|
|
|
|
|
feed('iline 1\nline 2<esc>')
|
|
|
|
|
|
|
|
|
|
feed('/line<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{10:^line} 1 |
|
|
|
|
|
{10:line} 2 |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{ content = { { '/line W [1/2]' } }, kind = 'search_count' },
|
|
|
|
|
},
|
|
|
|
|
}
|
2019-06-08 04:42:21 -07:00
|
|
|
|
|
|
|
|
|
feed('n')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{10:line} 1 |
|
|
|
|
|
{10:^line} 2 |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{ content = { { '/line [2/2]' } }, kind = 'search_count' },
|
|
|
|
|
},
|
|
|
|
|
}
|
2019-06-08 04:42:21 -07:00
|
|
|
|
end)
|
|
|
|
|
|
2019-06-21 01:00:35 -07:00
|
|
|
|
it(':hi Group output', function()
|
|
|
|
|
feed(':hi ErrorMsg<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-06-21 01:00:35 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
|
|
|
|
content = {
|
|
|
|
|
{ '\nErrorMsg ' },
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{ 'xxx', 9 },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
{ ' ' },
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{ 'ctermfg=', 18 },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
{ '15 ' },
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{ 'ctermbg=', 18 },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
{ '1 ' },
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{ 'guifg=', 18 },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
{ 'White ' },
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{ 'guibg=', 18 },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
{ 'Red' },
|
|
|
|
|
},
|
|
|
|
|
kind = '',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2019-06-21 01:00:35 -07:00
|
|
|
|
end)
|
|
|
|
|
|
2019-06-16 02:31:35 -07:00
|
|
|
|
it("doesn't crash with column adjustment #10069", function()
|
|
|
|
|
feed(':let [x,y] = [1,2]<cr>')
|
|
|
|
|
feed(':let x y<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-06-16 02:31:35 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{ content = { { 'x #1' } }, kind = '' },
|
|
|
|
|
{ content = { { 'y #2' } }, kind = '' },
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{ content = { { 'Press ENTER or type command to continue', 6 } }, kind = 'return_prompt' },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
},
|
|
|
|
|
}
|
2019-06-16 02:31:35 -07:00
|
|
|
|
end)
|
|
|
|
|
|
2019-05-09 14:54:04 -07:00
|
|
|
|
it('&showmode', function()
|
2017-10-31 08:46:02 -07:00
|
|
|
|
command('imap <f2> <cmd>echomsg "stuff"<cr>')
|
|
|
|
|
feed('i')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
2024-04-04 02:26:39 -07:00
|
|
|
|
showmode = { { '-- INSERT --', 5 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
feed('alphpabet<cr>alphanum<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
alphpabet |
|
|
|
|
|
alphanum |
|
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*2
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
2024-04-04 02:26:39 -07:00
|
|
|
|
showmode = { { '-- INSERT --', 5 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
feed('<c-x>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
alphpabet |
|
|
|
|
|
alphanum |
|
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*2
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
2024-04-04 02:26:39 -07:00
|
|
|
|
showmode = { { '-- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)', 5 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
feed('<c-p>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
alphpabet |
|
|
|
|
|
alphanum |
|
|
|
|
|
alphanum^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*2
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
popupmenu = {
|
|
|
|
|
anchor = { 1, 2, 0 },
|
|
|
|
|
items = { { 'alphpabet', '', '', '' }, { 'alphanum', '', '', '' } },
|
|
|
|
|
pos = 1,
|
|
|
|
|
},
|
2024-04-04 02:26:39 -07:00
|
|
|
|
showmode = { { '-- Keyword Local completion (^N^P) ', 5 }, { 'match 1 of 2', 6 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
-- echomsg and showmode don't overwrite each other, this is the same
|
|
|
|
|
-- as the TUI behavior with cmdheight=2 or larger.
|
|
|
|
|
feed('<f2>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
alphpabet |
|
|
|
|
|
alphanum |
|
|
|
|
|
alphanum^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*2
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
popupmenu = {
|
|
|
|
|
anchor = { 1, 2, 0 },
|
|
|
|
|
items = { { 'alphpabet', '', '', '' }, { 'alphanum', '', '', '' } },
|
|
|
|
|
pos = 1,
|
|
|
|
|
},
|
|
|
|
|
messages = { {
|
|
|
|
|
content = { { 'stuff' } },
|
|
|
|
|
kind = 'echomsg',
|
|
|
|
|
} },
|
2024-04-04 02:26:39 -07:00
|
|
|
|
showmode = { { '-- Keyword Local completion (^N^P) ', 5 }, { 'match 1 of 2', 6 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
feed('<c-p>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
alphpabet |
|
|
|
|
|
alphanum |
|
|
|
|
|
alphpabet^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*2
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
popupmenu = {
|
|
|
|
|
anchor = { 1, 2, 0 },
|
|
|
|
|
items = { { 'alphpabet', '', '', '' }, { 'alphanum', '', '', '' } },
|
|
|
|
|
pos = 0,
|
|
|
|
|
},
|
|
|
|
|
messages = { {
|
|
|
|
|
content = { { 'stuff' } },
|
|
|
|
|
kind = 'echomsg',
|
|
|
|
|
} },
|
2024-04-04 02:26:39 -07:00
|
|
|
|
showmode = { { '-- Keyword Local completion (^N^P) ', 5 }, { 'match 2 of 2', 6 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
feed('<esc>:messages<cr>')
|
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
alphpabet |
|
|
|
|
|
alphanum |
|
|
|
|
|
alphpabe^t |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*2
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
msg_history = { {
|
|
|
|
|
content = { { 'stuff' } },
|
|
|
|
|
kind = 'echomsg',
|
|
|
|
|
} },
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'Press ENTER or type command to continue', 6 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'return_prompt',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
end)
|
|
|
|
|
|
2019-05-09 14:54:04 -07:00
|
|
|
|
it('&showmode with macro-recording message', function()
|
2017-10-31 08:46:02 -07:00
|
|
|
|
feed('qq')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
2024-04-04 02:26:39 -07:00
|
|
|
|
showmode = { { 'recording @q', 5 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
feed('i')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
2024-04-04 02:26:39 -07:00
|
|
|
|
showmode = { { '-- INSERT --recording @q', 5 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
feed('<esc>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
2024-04-04 02:26:39 -07:00
|
|
|
|
showmode = { { 'recording @q', 5 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
feed('q')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2017-10-31 08:46:02 -07:00
|
|
|
|
]])
|
|
|
|
|
end)
|
|
|
|
|
|
2019-05-09 14:54:04 -07:00
|
|
|
|
it('shows macro-recording message with &noshowmode', function()
|
2024-01-02 18:09:18 -07:00
|
|
|
|
command('set noshowmode')
|
2017-10-31 08:46:02 -07:00
|
|
|
|
feed('qq')
|
|
|
|
|
-- also check mode to avoid immediate success
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
2024-04-04 02:26:39 -07:00
|
|
|
|
showmode = { { 'recording @q', 5 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
mode = 'normal',
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
feed('i')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
2024-04-04 02:26:39 -07:00
|
|
|
|
showmode = { { 'recording @q', 5 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
mode = 'insert',
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
feed('<esc>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
2024-04-04 02:26:39 -07:00
|
|
|
|
showmode = { { 'recording @q', 5 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
mode = 'normal',
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
feed('q')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
mode = 'normal',
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
end)
|
|
|
|
|
|
2019-05-09 14:54:04 -07:00
|
|
|
|
it('supports &showcmd and &ruler', function()
|
2017-10-31 08:46:02 -07:00
|
|
|
|
command('set showcmd ruler')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
ruler = { { '0,0-1 All' } },
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
feed('i')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
2024-04-04 02:26:39 -07:00
|
|
|
|
showmode = { { '-- INSERT --', 5 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
ruler = { { '0,1 All' } },
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
feed('abcde<cr>12345<esc>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
abcde |
|
|
|
|
|
1234^5 |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
ruler = { { '2,5 All' } },
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
feed('d')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
abcde |
|
|
|
|
|
1234^5 |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
showcmd = { { 'd' } },
|
|
|
|
|
ruler = { { '2,5 All' } },
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
feed('<esc>^')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
abcde |
|
|
|
|
|
^12345 |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
ruler = { { '2,1 All' } },
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
feed('d')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
abcde |
|
|
|
|
|
^12345 |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
showcmd = { { 'd' } },
|
|
|
|
|
ruler = { { '2,1 All' } },
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
feed('i')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
abcde |
|
|
|
|
|
^12345 |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
showcmd = { { 'di' } },
|
|
|
|
|
ruler = { { '2,1 All' } },
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
feed('w')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
abcde |
|
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
ruler = { { '2,0-1 All' } },
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
-- when ruler is part of statusline it is not externalized.
|
|
|
|
|
-- this will be added as part of future ext_statusline support
|
2024-01-02 18:09:18 -07:00
|
|
|
|
command('set laststatus=2')
|
2017-10-31 08:46:02 -07:00
|
|
|
|
screen:expect([[
|
|
|
|
|
abcde |
|
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*2
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{3:<o Name] [+] 2,0-1 All}|
|
2017-10-31 08:46:02 -07:00
|
|
|
|
]])
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
it('keeps history of message of different kinds', function()
|
|
|
|
|
feed(':echomsg "howdy"<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = { {
|
|
|
|
|
content = { { 'howdy' } },
|
|
|
|
|
kind = 'echomsg',
|
|
|
|
|
} },
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
-- always test a message without kind. If this one gets promoted to a
|
|
|
|
|
-- category, add a new message without kind.
|
|
|
|
|
feed('<c-c>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
|
|
|
|
content = { { 'Type :qa and press <Enter> to exit Nvim' } },
|
|
|
|
|
kind = '',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
feed(':echoerr "bork"<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = { {
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'bork', 9 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'echoerr',
|
|
|
|
|
} },
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
feed(':echo "xyz"<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = { {
|
|
|
|
|
content = { { 'xyz' } },
|
|
|
|
|
kind = 'echo',
|
|
|
|
|
} },
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
feed(':call nosuchfunction()<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'E117: Unknown function: nosuchfunction', 9 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'emsg',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
feed(':messages<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
msg_history = {
|
|
|
|
|
{ kind = 'echomsg', content = { { 'howdy' } } },
|
|
|
|
|
{ kind = '', content = { { 'Type :qa and press <Enter> to exit Nvim' } } },
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{ kind = 'echoerr', content = { { 'bork', 9 } } },
|
|
|
|
|
{ kind = 'emsg', content = { { 'E117: Unknown function: nosuchfunction', 9 } } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
},
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
2024-04-04 02:26:39 -07:00
|
|
|
|
content = { { 'Press ENTER or type command to continue', 6 } },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
kind = 'return_prompt',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
end)
|
|
|
|
|
|
2024-03-10 23:13:48 -07:00
|
|
|
|
it("implies ext_cmdline but allows changing 'cmdheight'", function()
|
2017-10-31 08:46:02 -07:00
|
|
|
|
eq(0, eval('&cmdheight'))
|
|
|
|
|
feed(':set cmdheight=1')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
cmdline = {
|
|
|
|
|
{
|
|
|
|
|
content = { { 'set cmdheight=1' } },
|
|
|
|
|
firstc = ':',
|
|
|
|
|
pos = 15,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
feed('<cr>')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
^ |
|
2024-03-10 23:13:48 -07:00
|
|
|
|
{1:~ }|*3
|
|
|
|
|
|
|
2017-10-31 08:46:02 -07:00
|
|
|
|
]])
|
2024-03-10 23:13:48 -07:00
|
|
|
|
eq(1, eval('&cmdheight'))
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
feed(':set cmdheight=0')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2024-03-10 23:13:48 -07:00
|
|
|
|
{1:~ }|*3
|
|
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
cmdline = {
|
|
|
|
|
{
|
|
|
|
|
content = { { 'set cmdheight=0' } },
|
|
|
|
|
firstc = ':',
|
|
|
|
|
pos = 15,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
feed('<cr>')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2017-10-31 08:46:02 -07:00
|
|
|
|
]])
|
|
|
|
|
eq(0, eval('&cmdheight'))
|
|
|
|
|
end)
|
|
|
|
|
|
2019-01-24 11:15:39 -07:00
|
|
|
|
it('supports multiline messages from lua', function()
|
2017-10-31 08:46:02 -07:00
|
|
|
|
feed(':lua error("such\\nmultiline\\nerror")<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
|
|
|
|
content = {
|
|
|
|
|
{
|
|
|
|
|
[[E5108: Error executing lua [string ":lua"]:1: such
|
2021-11-06 07:26:10 -07:00
|
|
|
|
multiline
|
|
|
|
|
error
|
|
|
|
|
stack traceback:
|
|
|
|
|
[C]: in function 'error'
|
2024-01-02 18:09:18 -07:00
|
|
|
|
[string ":lua"]:1: in main chunk]],
|
2024-04-04 02:26:39 -07:00
|
|
|
|
9,
|
2024-01-02 18:09:18 -07:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
kind = 'lua_error',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
end)
|
2019-01-24 11:15:39 -07:00
|
|
|
|
|
|
|
|
|
it('supports multiline messages from rpc', function()
|
|
|
|
|
feed(':call rpcrequest(1, "test_method")<cr>')
|
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-01-24 11:15:39 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
|
|
|
|
content = {
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{ "Error invoking 'test_method' on channel 1:\ncomplete\nerror\n\nmessage", 9 },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
},
|
|
|
|
|
kind = 'rpc_error',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
request_cb = function(name)
|
|
|
|
|
if name == 'test_method' then
|
|
|
|
|
set_method_error('complete\nerror\n\nmessage')
|
|
|
|
|
end
|
|
|
|
|
end,
|
|
|
|
|
}
|
2019-01-24 11:15:39 -07:00
|
|
|
|
end)
|
|
|
|
|
|
2023-11-21 18:50:28 -07:00
|
|
|
|
it('supports multiline messages for :map', function()
|
|
|
|
|
command('mapclear')
|
|
|
|
|
command('nmap Y y$')
|
|
|
|
|
command('nmap Q @@')
|
|
|
|
|
command('nnoremap j k')
|
|
|
|
|
feed(':map<cr>')
|
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
|
|
|
|
content = {
|
|
|
|
|
{ '\nn Q @@\nn Y y$\nn j ' },
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{ '*', 18 },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
{ ' k' },
|
|
|
|
|
},
|
|
|
|
|
kind = '',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2023-11-21 18:50:28 -07:00
|
|
|
|
end)
|
|
|
|
|
|
2019-06-02 15:08:32 -07:00
|
|
|
|
it('wildmode=list', function()
|
2019-06-03 02:23:10 -07:00
|
|
|
|
screen:try_resize(25, 7)
|
|
|
|
|
screen:set_option('ext_popupmenu', false)
|
2019-06-02 12:38:34 -07:00
|
|
|
|
|
|
|
|
|
command('set wildmenu wildmode=list')
|
|
|
|
|
feed(':set wildm<tab>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-06-02 12:38:34 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*6
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = { {
|
|
|
|
|
content = { { 'wildmenu wildmode' } },
|
2019-06-02 12:38:34 -07:00
|
|
|
|
kind = '',
|
2024-01-02 18:09:18 -07:00
|
|
|
|
} },
|
|
|
|
|
cmdline = {
|
|
|
|
|
{
|
|
|
|
|
firstc = ':',
|
|
|
|
|
content = { { 'set wildm' } },
|
|
|
|
|
pos = 9,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2019-06-02 12:38:34 -07:00
|
|
|
|
end)
|
2021-02-09 05:26:52 -07:00
|
|
|
|
|
|
|
|
|
it('hides prompt_for_number messages', function()
|
|
|
|
|
command('set spell')
|
|
|
|
|
feed('ihelllo<esc>')
|
|
|
|
|
|
|
|
|
|
feed('z=')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{100:helllo} |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2021-02-09 05:26:52 -07:00
|
|
|
|
{1:^~ }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
|
|
|
|
content = {
|
|
|
|
|
{
|
|
|
|
|
'Change "helllo" to:\n 1 "Hello"\n 2 "Hallo"\n 3 "Hullo"\nType number and <Enter> or click with the mouse (q or empty cancels): ',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
kind = '',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2021-02-09 05:26:52 -07:00
|
|
|
|
|
|
|
|
|
feed('1')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{100:helllo} |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2021-02-09 05:26:52 -07:00
|
|
|
|
{1:^~ }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{
|
|
|
|
|
content = {
|
|
|
|
|
{
|
|
|
|
|
'Change "helllo" to:\n 1 "Hello"\n 2 "Hallo"\n 3 "Hullo"\nType number and <Enter> or click with the mouse (q or empty cancels): ',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
kind = '',
|
|
|
|
|
},
|
|
|
|
|
{ content = { { '1' } }, kind = '' },
|
|
|
|
|
},
|
|
|
|
|
}
|
2021-02-09 05:26:52 -07:00
|
|
|
|
|
|
|
|
|
feed('<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2021-02-09 05:26:52 -07:00
|
|
|
|
^Hello |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2021-02-09 05:26:52 -07:00
|
|
|
|
end)
|
|
|
|
|
|
2022-06-10 02:23:17 -07:00
|
|
|
|
it('supports nvim_echo messages with multiple attrs', function()
|
2024-01-15 09:10:51 -07:00
|
|
|
|
async_meths.nvim_echo(
|
2024-01-02 18:09:18 -07:00
|
|
|
|
{ { 'wow, ', 'Search' }, { 'such\n\nvery ', 'ErrorMsg' }, { 'color', 'LineNr' } },
|
|
|
|
|
true,
|
|
|
|
|
{}
|
|
|
|
|
)
|
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2022-06-10 02:23:17 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{ content = { { 'wow, ', 10 }, { 'such\n\nvery ', 9 }, { 'color', 8 } }, kind = 'echomsg' },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
},
|
|
|
|
|
}
|
2022-06-10 02:23:17 -07:00
|
|
|
|
|
|
|
|
|
feed ':ls<cr>'
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2022-06-10 02:23:17 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{ content = { { '\n 1 %a "[No Name]" line 1' } }, kind = '' },
|
|
|
|
|
},
|
|
|
|
|
}
|
2022-06-10 02:23:17 -07:00
|
|
|
|
|
|
|
|
|
feed ':messages<cr>'
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2022-06-10 02:23:17 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{ content = { { 'Press ENTER or type command to continue', 6 } }, kind = 'return_prompt' },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
},
|
|
|
|
|
msg_history = {
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{ content = { { 'wow, ', 10 }, { 'such\n\nvery ', 9 }, { 'color', 8 } }, kind = 'echomsg' },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
},
|
|
|
|
|
}
|
2022-06-10 02:23:17 -07:00
|
|
|
|
|
|
|
|
|
feed '<cr>'
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2022-06-10 02:23:17 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2022-06-10 02:23:17 -07:00
|
|
|
|
end)
|
2023-01-12 20:47:55 -07:00
|
|
|
|
|
|
|
|
|
it('does not truncate messages', function()
|
2024-01-02 18:09:18 -07:00
|
|
|
|
command('write ' .. fname)
|
|
|
|
|
screen:expect({
|
|
|
|
|
messages = {
|
|
|
|
|
{ content = { { string.format('"%s" [New] 0L, 0B written', fname) } }, kind = '' },
|
|
|
|
|
},
|
|
|
|
|
})
|
2023-01-12 20:47:55 -07:00
|
|
|
|
end)
|
2019-06-02 12:38:34 -07:00
|
|
|
|
end)
|
|
|
|
|
|
2019-01-24 11:15:39 -07:00
|
|
|
|
describe('ui/builtin messages', function()
|
|
|
|
|
local screen
|
|
|
|
|
before_each(function()
|
|
|
|
|
clear()
|
|
|
|
|
screen = Screen.new(60, 7)
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:attach({ rgb = true, ext_popupmenu = true })
|
2024-04-04 02:26:39 -07:00
|
|
|
|
screen:add_extra_attr_ids {
|
|
|
|
|
[100] = { background = Screen.colors.LightRed },
|
|
|
|
|
[101] = { background = Screen.colors.Grey20 },
|
|
|
|
|
[102] = { foreground = Screen.colors.Magenta1, bold = true },
|
2022-06-10 02:23:17 -07:00
|
|
|
|
}
|
2019-01-24 11:15:39 -07:00
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
it('supports multiline messages from rpc', function()
|
|
|
|
|
feed(':call rpcrequest(1, "test_method")<cr>')
|
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-01-24 11:15:39 -07:00
|
|
|
|
{3: }|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{9:Error invoking 'test_method' on channel 1:} |
|
|
|
|
|
{9:complete} |
|
|
|
|
|
{9:error} |
|
2019-01-24 11:15:39 -07:00
|
|
|
|
|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{9:message} |
|
|
|
|
|
{6:Press ENTER or type command to continue}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
request_cb = function(name)
|
|
|
|
|
if name == 'test_method' then
|
|
|
|
|
set_method_error('complete\nerror\n\nmessage')
|
|
|
|
|
end
|
|
|
|
|
end,
|
|
|
|
|
}
|
2019-01-24 11:15:39 -07:00
|
|
|
|
end)
|
2019-06-21 01:00:35 -07:00
|
|
|
|
|
|
|
|
|
it(':hi Group output', function()
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:try_resize(70, 7)
|
2019-06-21 01:00:35 -07:00
|
|
|
|
feed(':hi ErrorMsg<cr>')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*2
|
2019-06-21 01:00:35 -07:00
|
|
|
|
{3: }|
|
|
|
|
|
:hi ErrorMsg |
|
2024-04-04 02:26:39 -07:00
|
|
|
|
ErrorMsg {9:xxx} {18:ctermfg=}15 {18:ctermbg=}1 {18:guifg=}White {18:guibg=}Red |
|
|
|
|
|
{6:Press ENTER or type command to continue}^ |
|
2019-06-21 01:00:35 -07:00
|
|
|
|
]])
|
|
|
|
|
|
|
|
|
|
feed('<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:try_resize(30, 7)
|
2019-06-21 01:00:35 -07:00
|
|
|
|
feed(':hi ErrorMsg<cr>')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
:hi ErrorMsg |
|
2024-04-04 02:26:39 -07:00
|
|
|
|
ErrorMsg {9:xxx} {18:ctermfg=}15 |
|
|
|
|
|
{18:ctermbg=}1 |
|
|
|
|
|
{18:guifg=}White|
|
|
|
|
|
{18:guibg=}Red |
|
|
|
|
|
{6:Press ENTER or type command to}|
|
|
|
|
|
{6: continue}^ |
|
2019-06-21 01:00:35 -07:00
|
|
|
|
]])
|
|
|
|
|
feed('<cr>')
|
|
|
|
|
|
|
|
|
|
-- screen size doesn't affect internal output #10285
|
2024-01-02 18:09:18 -07:00
|
|
|
|
eq('ErrorMsg xxx ctermfg=15 ctermbg=1 guifg=White guibg=Red', exec_capture('hi ErrorMsg'))
|
2019-06-21 01:00:35 -07:00
|
|
|
|
end)
|
2019-07-13 11:08:28 -07:00
|
|
|
|
|
|
|
|
|
it(':syntax list langGroup output', function()
|
2024-01-02 18:09:18 -07:00
|
|
|
|
command('syntax on')
|
|
|
|
|
command('set syntax=vim')
|
|
|
|
|
screen:try_resize(110, 7)
|
2019-07-13 11:08:28 -07:00
|
|
|
|
feed(':syntax list vimComment<cr>')
|
|
|
|
|
screen:expect([[
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{102:--- Syntax items ---} |
|
|
|
|
|
vimComment {18:xxx} {18:match} /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 {18:excludenl} {18:contains}=@vimCommentGroup,vimCommentString |
|
2019-07-13 11:08:28 -07:00
|
|
|
|
|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{18:match} /\<endif\s\+".*$/ms=s+5,lc=5 {18:contains}=@vimCommentGroup,vimCommentString |
|
|
|
|
|
{18:match} /\<else\s\+".*$/ms=s+4,lc=4 {18:contains}=@vimCommentGroup,vimCommentString |
|
|
|
|
|
{18:links to} Comment |
|
|
|
|
|
{6:Press ENTER or type command to continue}^ |
|
2019-07-13 11:08:28 -07:00
|
|
|
|
]])
|
|
|
|
|
|
|
|
|
|
feed('<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:try_resize(55, 7)
|
2019-07-13 11:08:28 -07:00
|
|
|
|
feed(':syntax list vimComment<cr>')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{18:match} /\<endif\s\+".*$/ms=s+5,lc=5 |
|
|
|
|
|
{18:contains}=@vimCommentGroup,vimCommentString |
|
|
|
|
|
{18:match} /\<else\s\+".*$/ms=s+4,lc=4 {18:c}|
|
|
|
|
|
{18:ontains}=@vimCommentGroup,vimCommentString |
|
|
|
|
|
{18:links to} Comment |
|
|
|
|
|
{6:Press ENTER or type command to continue}^ |
|
2019-07-13 11:08:28 -07:00
|
|
|
|
]])
|
|
|
|
|
feed('<cr>')
|
|
|
|
|
|
|
|
|
|
-- ignore final whitespace inside string
|
|
|
|
|
-- luacheck: push ignore
|
2024-01-02 18:09:18 -07:00
|
|
|
|
eq(
|
|
|
|
|
[[--- Syntax items ---
|
2019-07-13 11:08:28 -07:00
|
|
|
|
vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vimCommentGroup,vimCommentString
|
|
|
|
|
match /\<endif\s\+".*$/ms=s+5,lc=5 contains=@vimCommentGroup,vimCommentString
|
|
|
|
|
match /\<else\s\+".*$/ms=s+4,lc=4 contains=@vimCommentGroup,vimCommentString
|
|
|
|
|
links to Comment]],
|
2024-01-02 18:09:18 -07:00
|
|
|
|
exec_capture('syntax list vimComment')
|
|
|
|
|
)
|
2019-07-13 11:08:28 -07:00
|
|
|
|
-- luacheck: pop
|
|
|
|
|
end)
|
2019-09-17 11:26:43 -07:00
|
|
|
|
|
2023-10-13 00:01:26 -07:00
|
|
|
|
it('no empty line after :silent #12099', function()
|
|
|
|
|
exec([[
|
|
|
|
|
func T1()
|
|
|
|
|
silent !echo
|
|
|
|
|
echo "message T1"
|
|
|
|
|
endfunc
|
|
|
|
|
func T2()
|
|
|
|
|
silent lua print("lua message")
|
|
|
|
|
echo "message T2"
|
|
|
|
|
endfunc
|
|
|
|
|
func T3()
|
|
|
|
|
silent call nvim_out_write("api message\n")
|
|
|
|
|
echo "message T3"
|
|
|
|
|
endfunc
|
|
|
|
|
]])
|
|
|
|
|
feed(':call T1()<CR>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2023-10-13 00:01:26 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*5
|
2023-10-13 00:01:26 -07:00
|
|
|
|
message T1 |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2023-10-13 00:01:26 -07:00
|
|
|
|
feed(':call T2()<CR>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2023-10-13 00:01:26 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*5
|
2023-10-13 00:01:26 -07:00
|
|
|
|
message T2 |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2023-10-13 00:01:26 -07:00
|
|
|
|
feed(':call T3()<CR>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2023-10-13 00:01:26 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*5
|
2023-10-13 00:01:26 -07:00
|
|
|
|
message T3 |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2023-10-13 00:01:26 -07:00
|
|
|
|
end)
|
|
|
|
|
|
2019-09-17 11:26:43 -07:00
|
|
|
|
it('supports ruler with laststatus=0', function()
|
2024-01-02 18:09:18 -07:00
|
|
|
|
command('set ruler laststatus=0')
|
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-09-17 11:26:43 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*5
|
2019-09-17 11:26:43 -07:00
|
|
|
|
0,0-1 All |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-17 11:26:43 -07:00
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
command('hi MsgArea guibg=#333333')
|
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-09-17 11:26:43 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*5
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{101: 0,0-1 All }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-17 11:26:43 -07:00
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
command('set rulerformat=%15(%c%V\\ %p%%%)')
|
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-09-17 11:26:43 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*5
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{101: 0,0-1 100% }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-17 11:26:43 -07:00
|
|
|
|
end)
|
2020-01-16 07:48:42 -07:00
|
|
|
|
|
|
|
|
|
it('supports echo with CRLF line separators', function()
|
|
|
|
|
feed(':echo "line 1\\r\\nline 2"<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2020-01-16 07:48:42 -07:00
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*2
|
2020-01-16 07:48:42 -07:00
|
|
|
|
{3: }|
|
|
|
|
|
line 1 |
|
|
|
|
|
line 2 |
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{6:Press ENTER or type command to continue}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2020-01-16 07:48:42 -07:00
|
|
|
|
|
|
|
|
|
feed('<cr>:echo "abc\\rz"<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2020-01-16 07:48:42 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*5
|
2020-01-16 07:48:42 -07:00
|
|
|
|
zbc |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2020-01-16 07:48:42 -07:00
|
|
|
|
end)
|
2020-01-24 02:52:17 -07:00
|
|
|
|
|
2022-08-23 07:00:19 -07:00
|
|
|
|
it('redraws UPD_NOT_VALID correctly after message', function()
|
|
|
|
|
-- edge case: only one window was set UPD_NOT_VALID. Original report
|
2020-01-24 02:52:17 -07:00
|
|
|
|
-- used :make, but fake it using one command to set the current
|
2022-08-23 07:00:19 -07:00
|
|
|
|
-- window UPD_NOT_VALID and another to show a long message.
|
2024-01-02 18:09:18 -07:00
|
|
|
|
command('set more')
|
2020-01-24 02:52:17 -07:00
|
|
|
|
feed(':new<cr><c-w><c-w>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2020-01-24 02:52:17 -07:00
|
|
|
|
|
|
|
|
|
|
{1:~ }|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{2:[No Name] }|
|
2020-01-24 02:52:17 -07:00
|
|
|
|
^ |
|
|
|
|
|
{1:~ }|
|
|
|
|
|
{3:[No Name] }|
|
|
|
|
|
:new |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2020-01-24 02:52:17 -07:00
|
|
|
|
|
|
|
|
|
feed(':set colorcolumn=10 | digraphs<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2020-02-19 05:08:12 -07:00
|
|
|
|
:set colorcolumn=10 | digraphs |
|
2024-04-04 02:26:39 -07:00
|
|
|
|
NU {18:^@} 10 SH {18:^A} 1 SX {18:^B} 2 EX {18:^C} 3 |
|
|
|
|
|
ET {18:^D} 4 EQ {18:^E} 5 AK {18:^F} 6 BL {18:^G} 7 |
|
|
|
|
|
BS {18:^H} 8 HT {18:^I} 9 LF {18:^@} 10 VT {18:^K} 11 |
|
|
|
|
|
FF {18:^L} 12 CR {18:^M} 13 SO {18:^N} 14 SI {18:^O} 15 |
|
|
|
|
|
DL {18:^P} 16 D1 {18:^Q} 17 D2 {18:^R} 18 D3 {18:^S} 19 |
|
|
|
|
|
{6:-- More --}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2020-01-24 02:52:17 -07:00
|
|
|
|
|
2020-02-19 05:08:12 -07:00
|
|
|
|
feed('q')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2020-01-24 02:52:17 -07:00
|
|
|
|
|
|
|
|
|
|
{1:~ }|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{2:[No Name] }|
|
|
|
|
|
^ {100: } |
|
2020-01-24 02:52:17 -07:00
|
|
|
|
{1:~ }|
|
|
|
|
|
{3:[No Name] }|
|
|
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2020-01-24 02:52:17 -07:00
|
|
|
|
|
|
|
|
|
-- edge case: just covers statusline
|
|
|
|
|
feed(':set colorcolumn=5 | lua error("x\\n\\nx")<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{9:E5108: Error executing lua [string ":lua"]:1: x} |
|
2020-01-24 02:52:17 -07:00
|
|
|
|
|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{9:x} |
|
|
|
|
|
{9:stack traceback:} |
|
|
|
|
|
{9: [C]: in function 'error'} |
|
|
|
|
|
{9: [string ":lua"]:1: in main chunk} |
|
|
|
|
|
{6:Press ENTER or type command to continue}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2020-01-24 02:52:17 -07:00
|
|
|
|
|
|
|
|
|
feed('<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2020-01-24 02:52:17 -07:00
|
|
|
|
|
|
|
|
|
|
{1:~ }|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{2:[No Name] }|
|
|
|
|
|
^ {100: } |
|
2020-01-24 02:52:17 -07:00
|
|
|
|
{1:~ }|
|
|
|
|
|
{3:[No Name] }|
|
|
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2020-01-24 02:52:17 -07:00
|
|
|
|
|
|
|
|
|
-- edge case: just covers lowest window line
|
|
|
|
|
feed(':set colorcolumn=5 | lua error("x\\n\\n\\nx")<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{9:E5108: Error executing lua [string ":lua"]:1: x} |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
|*2
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{9:x} |
|
|
|
|
|
{9:stack traceback:} |
|
|
|
|
|
{9: [C]: in function 'error'} |
|
|
|
|
|
{6:-- More --}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2020-01-24 02:52:17 -07:00
|
|
|
|
|
|
|
|
|
feed('<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2023-12-09 05:42:00 -07:00
|
|
|
|
|*2
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{9:x} |
|
|
|
|
|
{9:stack traceback:} |
|
|
|
|
|
{9: [C]: in function 'error'} |
|
|
|
|
|
{9: [string ":lua"]:1: in main chunk} |
|
|
|
|
|
{6:Press ENTER or type command to continue}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2020-01-24 02:52:17 -07:00
|
|
|
|
end)
|
2022-06-10 02:23:17 -07:00
|
|
|
|
|
|
|
|
|
it('supports nvim_echo messages with multiple attrs', function()
|
2024-01-15 09:10:51 -07:00
|
|
|
|
async_meths.nvim_echo(
|
2024-01-02 18:09:18 -07:00
|
|
|
|
{ { 'wow, ', 'Search' }, { 'such\n\nvery ', 'ErrorMsg' }, { 'color', 'LineNr' } },
|
|
|
|
|
true,
|
|
|
|
|
{}
|
|
|
|
|
)
|
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2022-06-10 02:23:17 -07:00
|
|
|
|
|
|
|
|
|
|
{1:~ }|
|
|
|
|
|
{3: }|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{10:wow, }{9:such} |
|
2022-06-10 02:23:17 -07:00
|
|
|
|
|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{9:very }{8:color} |
|
|
|
|
|
{6:Press ENTER or type command to continue}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2022-06-10 02:23:17 -07:00
|
|
|
|
|
|
|
|
|
feed '<cr>'
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2022-06-10 02:23:17 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*5
|
2022-06-10 02:23:17 -07:00
|
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2022-06-10 02:23:17 -07:00
|
|
|
|
|
|
|
|
|
feed ':messages<cr>'
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2022-06-10 02:23:17 -07:00
|
|
|
|
|
|
|
|
|
|
{1:~ }|
|
|
|
|
|
{3: }|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{10:wow, }{9:such} |
|
2022-06-10 02:23:17 -07:00
|
|
|
|
|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{9:very }{8:color} |
|
|
|
|
|
{6:Press ENTER or type command to continue}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2022-06-10 02:23:17 -07:00
|
|
|
|
end)
|
2022-07-12 18:06:31 -07:00
|
|
|
|
|
|
|
|
|
it('prints lines in Ex mode correctly with a burst of carriage returns #19341', function()
|
|
|
|
|
command('set number')
|
2024-01-12 10:59:57 -07:00
|
|
|
|
api.nvim_buf_set_lines(0, 0, 0, true, { 'aaa', 'bbb', 'ccc' })
|
2022-07-12 18:06:31 -07:00
|
|
|
|
feed('gggQ<CR><CR>1<CR><CR>vi')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{8: 2 }bbb |
|
|
|
|
|
{8: 3 }ccc |
|
2022-07-12 18:06:31 -07:00
|
|
|
|
:1 |
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{8: 1 }aaa |
|
|
|
|
|
{8: 2 }bbb |
|
2022-07-12 18:06:31 -07:00
|
|
|
|
:vi^ |
|
|
|
|
|
]])
|
|
|
|
|
feed('<CR>')
|
|
|
|
|
screen:expect([[
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{8: 1 }aaa |
|
|
|
|
|
{8: 2 }^bbb |
|
|
|
|
|
{8: 3 }ccc |
|
|
|
|
|
{8: 4 } |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*2
|
2022-07-12 18:06:31 -07:00
|
|
|
|
|
|
|
|
|
|
]])
|
|
|
|
|
end)
|
2022-06-26 00:20:44 -07:00
|
|
|
|
|
2023-11-10 00:24:36 -07:00
|
|
|
|
describe('echo messages are shown when immediately followed by', function()
|
|
|
|
|
--- @param to_block string command to cause a blocking wait
|
|
|
|
|
--- @param to_unblock number|string number: timeout for blocking screen
|
|
|
|
|
--- string: keys to stop the blocking wait
|
|
|
|
|
local function test_flush_before_block(to_block, to_unblock)
|
|
|
|
|
local timeout = type(to_unblock) == 'number' and to_unblock or nil
|
|
|
|
|
exec(([[
|
|
|
|
|
func PrintAndWait()
|
|
|
|
|
echon "aaa\nbbb"
|
|
|
|
|
%s
|
|
|
|
|
echon "\nccc"
|
|
|
|
|
endfunc
|
|
|
|
|
]]):format(to_block))
|
|
|
|
|
feed(':call PrintAndWait()<CR>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2023-11-10 00:24:36 -07:00
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2023-11-10 00:24:36 -07:00
|
|
|
|
{3: }|
|
|
|
|
|
aaa |
|
|
|
|
|
bbb^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
timeout = timeout,
|
|
|
|
|
}
|
2023-11-10 00:24:36 -07:00
|
|
|
|
if type(to_unblock) == 'string' then
|
|
|
|
|
feed(to_unblock)
|
|
|
|
|
end
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2023-11-10 00:24:36 -07:00
|
|
|
|
|
|
|
|
|
|
{1:~ }|
|
|
|
|
|
{3: }|
|
|
|
|
|
aaa |
|
|
|
|
|
bbb |
|
|
|
|
|
ccc |
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{6:Press ENTER or type command to continue}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2023-11-10 00:24:36 -07:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
it('getchar()', function()
|
|
|
|
|
test_flush_before_block([[call getchar()]], 'k')
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
it('wait()', function()
|
|
|
|
|
test_flush_before_block([[call wait(300, '0')]], 100)
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
it('lua vim.wait()', function()
|
|
|
|
|
test_flush_before_block([[lua vim.wait(300, function() end)]], 100)
|
|
|
|
|
end)
|
2022-06-26 00:20:44 -07:00
|
|
|
|
end)
|
2022-11-11 01:46:45 -07:00
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
it('consecutive calls to win_move_statusline() work after multiline message #21014', function()
|
2024-01-15 09:10:51 -07:00
|
|
|
|
async_meths.nvim_exec(
|
2024-01-02 18:09:18 -07:00
|
|
|
|
[[
|
2022-11-11 01:46:45 -07:00
|
|
|
|
echo "\n"
|
|
|
|
|
call win_move_statusline(0, -4)
|
|
|
|
|
call win_move_statusline(0, 4)
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
false
|
|
|
|
|
)
|
2022-11-11 01:46:45 -07:00
|
|
|
|
screen:expect([[
|
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2022-11-11 01:46:45 -07:00
|
|
|
|
{3: }|
|
|
|
|
|
|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{6:Press ENTER or type command to continue}^ |
|
2022-11-11 01:46:45 -07:00
|
|
|
|
]])
|
|
|
|
|
feed('<CR>')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*5
|
2022-11-11 01:46:45 -07:00
|
|
|
|
|
|
|
|
|
|
]])
|
2024-01-12 10:59:57 -07:00
|
|
|
|
eq(1, api.nvim_get_option_value('cmdheight', {}))
|
2022-11-11 01:46:45 -07:00
|
|
|
|
end)
|
2023-11-23 19:44:19 -07:00
|
|
|
|
|
|
|
|
|
it('using nvim_echo in VimResized does not cause hit-enter prompt #26139', function()
|
|
|
|
|
command([[au VimResized * lua vim.api.nvim_echo({ { '123456' } }, true, {})]])
|
|
|
|
|
screen:try_resize(60, 5)
|
|
|
|
|
screen:expect([[
|
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2023-11-23 19:44:19 -07:00
|
|
|
|
|
|
|
|
|
|
]])
|
2024-01-12 10:59:57 -07:00
|
|
|
|
eq({ mode = 'n', blocking = false }, api.nvim_get_mode())
|
2023-11-23 19:44:19 -07:00
|
|
|
|
end)
|
2024-02-11 03:12:56 -07:00
|
|
|
|
|
|
|
|
|
it('bottom of screen is cleared after increasing &cmdheight #20360', function()
|
|
|
|
|
command('set laststatus=2')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
^ |
|
|
|
|
|
{1:~ }|*4
|
|
|
|
|
{3:[No Name] }|
|
|
|
|
|
|
|
|
|
|
|
]])
|
|
|
|
|
command('set cmdheight=4')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
^ |
|
|
|
|
|
{1:~ }|
|
|
|
|
|
{3:[No Name] }|
|
|
|
|
|
|*4
|
|
|
|
|
]])
|
|
|
|
|
end)
|
2024-04-15 19:38:17 -07:00
|
|
|
|
|
|
|
|
|
it('supports :intro with cmdheight=0 #26505', function()
|
|
|
|
|
screen:try_resize(80, 24)
|
|
|
|
|
command('set cmdheight=0')
|
|
|
|
|
feed(':intro<CR>')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
|*5
|
|
|
|
|
{MATCH:.*}|
|
|
|
|
|
|
|
|
|
|
|
Nvim is open source and freely distributable |
|
|
|
|
|
https://neovim.io/#chat |
|
|
|
|
|
|
|
|
|
|
|
type :help nvim{18:<Enter>} if you are new! |
|
|
|
|
|
type :checkhealth{18:<Enter>} to optimize Nvim |
|
|
|
|
|
type :q{18:<Enter>} to exit |
|
|
|
|
|
type :help{18:<Enter>} for help |
|
|
|
|
|
|
|
|
|
|
|
{MATCH: +}type :help news{18:<Enter>} to see changes in v{MATCH:%d+%.%d+ +}|
|
|
|
|
|
|
|
|
|
|
|
Help poor children in Uganda! |
|
|
|
|
|
type :help iccf{18:<Enter>} for information |
|
|
|
|
|
|*2
|
|
|
|
|
{3: }|
|
|
|
|
|
|
|
|
|
|
|
{6:Press ENTER or type command to continue}^ |
|
|
|
|
|
]])
|
|
|
|
|
feed('<CR>')
|
|
|
|
|
assert_alive()
|
|
|
|
|
end)
|
2017-10-31 08:46:02 -07:00
|
|
|
|
end)
|
|
|
|
|
|
2022-11-09 15:16:54 -07:00
|
|
|
|
it('calling screenstring() after redrawing between messages without UI #20999', function()
|
|
|
|
|
clear()
|
|
|
|
|
exec([[
|
|
|
|
|
echo repeat('a', 100)
|
|
|
|
|
redraw
|
|
|
|
|
echo "\n"
|
|
|
|
|
call screenstring(1, 1)
|
|
|
|
|
]])
|
|
|
|
|
assert_alive()
|
|
|
|
|
end)
|
|
|
|
|
|
2017-10-31 08:46:02 -07:00
|
|
|
|
describe('ui/ext_messages', function()
|
|
|
|
|
local screen
|
|
|
|
|
|
|
|
|
|
before_each(function()
|
2024-01-02 18:09:18 -07:00
|
|
|
|
clear { args_rm = { '--headless' }, args = { '--cmd', 'set shortmess-=I' } }
|
2017-10-31 08:46:02 -07:00
|
|
|
|
screen = Screen.new(80, 24)
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:attach({ rgb = true, ext_messages = true, ext_popupmenu = true })
|
2017-10-31 08:46:02 -07:00
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
it('supports intro screen', function()
|
|
|
|
|
-- intro message is not externalized. But check that it still works.
|
|
|
|
|
-- Note parts of it depends on version or is indeterministic. We ignore those parts.
|
2024-03-25 06:40:22 -07:00
|
|
|
|
local introscreen = [[
|
2017-10-31 08:46:02 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2019-11-09 23:22:24 -07:00
|
|
|
|
{MATCH:.*}|
|
2017-10-31 08:46:02 -07:00
|
|
|
|
{1:~ }|
|
|
|
|
|
{1:~ }Nvim is open source and freely distributable{1: }|
|
|
|
|
|
{1:~ }https://neovim.io/#chat{1: }|
|
|
|
|
|
{1:~ }|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{1:~ }type :help nvim{18:<Enter>} if you are new! {1: }|
|
|
|
|
|
{1:~ }type :checkhealth{18:<Enter>} to optimize Nvim{1: }|
|
|
|
|
|
{1:~ }type :q{18:<Enter>} to exit {1: }|
|
|
|
|
|
{1:~ }type :help{18:<Enter>} for help {1: }|
|
2017-10-31 08:46:02 -07:00
|
|
|
|
{1:~ }|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{1:~{MATCH: +}}type :help news{18:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}|
|
2022-10-16 14:55:18 -07:00
|
|
|
|
{1:~ }|
|
2024-03-15 14:39:34 -07:00
|
|
|
|
{1:~ }Help poor children in Uganda!{1: }|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{1:~ }type :help iccf{18:<Enter>} for information {1: }|
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*5
|
2024-03-25 06:40:22 -07:00
|
|
|
|
]]
|
2024-04-04 02:26:39 -07:00
|
|
|
|
local showmode = { { '-- INSERT --', 5 } }
|
2024-03-25 06:40:22 -07:00
|
|
|
|
screen:expect(introscreen)
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
2024-03-14 02:03:59 -07:00
|
|
|
|
-- <c-l> (same as :mode) does _not_ clear intro message
|
|
|
|
|
feed('<c-l>i')
|
2024-03-28 06:30:16 -07:00
|
|
|
|
screen:expect { grid = introscreen, showmode = showmode }
|
2024-03-25 06:40:22 -07:00
|
|
|
|
|
2024-03-28 06:30:16 -07:00
|
|
|
|
-- opening a float without focus also does not
|
|
|
|
|
local win = api.nvim_open_win(api.nvim_create_buf(false, false), false, {
|
2024-03-25 06:40:22 -07:00
|
|
|
|
relative = 'editor',
|
|
|
|
|
height = 1,
|
|
|
|
|
width = 5,
|
|
|
|
|
row = 1,
|
|
|
|
|
col = 5,
|
|
|
|
|
})
|
2024-03-14 02:03:59 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2024-03-28 06:30:16 -07:00
|
|
|
|
^ |
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{1:~ }{4: }{1: }|
|
2024-03-25 06:40:22 -07:00
|
|
|
|
{1:~ }|*3
|
2024-03-14 02:03:59 -07:00
|
|
|
|
{MATCH:.*}|
|
|
|
|
|
{1:~ }|
|
|
|
|
|
{1:~ }Nvim is open source and freely distributable{1: }|
|
|
|
|
|
{1:~ }https://neovim.io/#chat{1: }|
|
|
|
|
|
{1:~ }|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{1:~ }type :help nvim{18:<Enter>} if you are new! {1: }|
|
|
|
|
|
{1:~ }type :checkhealth{18:<Enter>} to optimize Nvim{1: }|
|
|
|
|
|
{1:~ }type :q{18:<Enter>} to exit {1: }|
|
|
|
|
|
{1:~ }type :help{18:<Enter>} for help {1: }|
|
2024-03-14 02:03:59 -07:00
|
|
|
|
{1:~ }|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{1:~{MATCH: +}}type :help news{18:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}|
|
2024-03-14 02:03:59 -07:00
|
|
|
|
{1:~ }|
|
2024-03-15 14:39:34 -07:00
|
|
|
|
{1:~ }Help poor children in Uganda!{1: }|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{1:~ }type :help iccf{18:<Enter>} for information {1: }|
|
2024-03-14 02:03:59 -07:00
|
|
|
|
{1:~ }|*5
|
|
|
|
|
]],
|
2024-03-28 06:30:16 -07:00
|
|
|
|
showmode = showmode,
|
2024-03-14 02:03:59 -07:00
|
|
|
|
}
|
2024-03-28 06:30:16 -07:00
|
|
|
|
|
2024-03-25 06:40:22 -07:00
|
|
|
|
api.nvim_win_close(win, true)
|
2024-03-28 06:30:16 -07:00
|
|
|
|
screen:expect { grid = introscreen, showmode = showmode }
|
2024-03-14 02:03:59 -07:00
|
|
|
|
|
|
|
|
|
-- but editing text does..
|
2024-03-28 06:30:16 -07:00
|
|
|
|
feed('x')
|
2024-03-14 02:03:59 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
|
|
|
|
x^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*23
|
2024-03-14 02:03:59 -07:00
|
|
|
|
]],
|
2024-03-28 06:30:16 -07:00
|
|
|
|
showmode = showmode,
|
2024-03-14 02:03:59 -07:00
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
2024-03-14 02:03:59 -07:00
|
|
|
|
feed('<esc>:intro<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2023-10-05 05:44:13 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
|*4
|
2019-11-09 23:22:24 -07:00
|
|
|
|
{MATCH:.*}|
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
|
|
|
|
Nvim is open source and freely distributable |
|
|
|
|
|
https://neovim.io/#chat |
|
|
|
|
|
|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
type :help nvim{18:<Enter>} if you are new! |
|
|
|
|
|
type :checkhealth{18:<Enter>} to optimize Nvim |
|
|
|
|
|
type :q{18:<Enter>} to exit |
|
|
|
|
|
type :help{18:<Enter>} for help |
|
2017-10-31 08:46:02 -07:00
|
|
|
|
|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{MATCH: +}type :help news{18:<Enter>} to see changes in v{MATCH:%d+%.%d+ +}|
|
2022-10-16 14:55:18 -07:00
|
|
|
|
|
|
2024-03-15 14:39:34 -07:00
|
|
|
|
Help poor children in Uganda! |
|
2024-04-04 02:26:39 -07:00
|
|
|
|
type :help iccf{18:<Enter>} for information |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
|*5
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{ content = { { 'Press ENTER or type command to continue', 6 } }, kind = 'return_prompt' },
|
2024-01-02 18:09:18 -07:00
|
|
|
|
},
|
|
|
|
|
}
|
2024-03-14 02:03:59 -07:00
|
|
|
|
|
|
|
|
|
feed('<cr>')
|
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
|
|
|
|
^x |
|
|
|
|
|
{1:~ }|*23
|
|
|
|
|
]],
|
|
|
|
|
}
|
2017-10-31 08:46:02 -07:00
|
|
|
|
end)
|
2022-04-30 00:49:29 -07:00
|
|
|
|
|
2024-03-28 06:30:16 -07:00
|
|
|
|
it('clears intro screen when new buffer is active', function()
|
|
|
|
|
api.nvim_set_current_buf(api.nvim_create_buf(true, false))
|
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
|
|
|
|
^ |
|
|
|
|
|
{1:~ }|*23
|
|
|
|
|
]],
|
|
|
|
|
}
|
|
|
|
|
end)
|
|
|
|
|
|
2024-03-28 06:47:04 -07:00
|
|
|
|
it('clears intro screen when new buffer is active in floating window', function()
|
|
|
|
|
local win_opts = { relative = 'editor', height = 1, width = 5, row = 1, col = 5 }
|
|
|
|
|
api.nvim_open_win(api.nvim_create_buf(false, false), true, win_opts)
|
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
|
|
|
|
|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{1:~ }{4:^ }{1: }|
|
2024-03-28 06:47:04 -07:00
|
|
|
|
{1:~ }|*22
|
|
|
|
|
]],
|
|
|
|
|
}
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
it('clears intro screen when initial buffer is active in floating window', function()
|
|
|
|
|
local win_opts = { relative = 'editor', height = 1, width = 5, row = 1, col = 5 }
|
|
|
|
|
api.nvim_open_win(api.nvim_get_current_buf(), true, win_opts)
|
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
|
|
|
|
|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{1:~ }{4:^ }{1: }|
|
2024-03-28 06:47:04 -07:00
|
|
|
|
{1:~ }|*22
|
|
|
|
|
]],
|
|
|
|
|
}
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
it('clears intro screen when initial window is converted to be floating', function()
|
|
|
|
|
exec_lua([[
|
|
|
|
|
local init_win_id = vim.api.nvim_get_current_win()
|
|
|
|
|
vim.cmd('split')
|
|
|
|
|
local win_opts = { relative = 'editor', height = 1, width = 5, row = 1, col = 5 }
|
|
|
|
|
vim.api.nvim_win_set_config(init_win_id, win_opts)
|
|
|
|
|
vim.api.nvim_set_current_win(init_win_id)
|
|
|
|
|
]])
|
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
|
|
|
|
|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{1:~ }{4:^ }{1: }|
|
2024-03-28 06:47:04 -07:00
|
|
|
|
{1:~ }|*21
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{2:[No Name] }|
|
2024-03-28 06:47:04 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
|
|
|
|
end)
|
|
|
|
|
|
2022-04-30 00:49:29 -07:00
|
|
|
|
it('supports global statusline', function()
|
2024-01-02 18:09:18 -07:00
|
|
|
|
feed(':set laststatus=3<cr>')
|
|
|
|
|
feed(':sp<cr>')
|
|
|
|
|
feed(':set cmdheight<cr>')
|
|
|
|
|
screen:expect({
|
|
|
|
|
grid = [[
|
2022-04-30 00:49:29 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*10
|
2022-05-15 09:34:44 -07:00
|
|
|
|
────────────────────────────────────────────────────────────────────────────────|
|
2022-04-30 00:49:29 -07:00
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*10
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{3:[No Name] }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{ content = { { ' cmdheight=0' } }, kind = '' },
|
|
|
|
|
},
|
|
|
|
|
})
|
2022-04-30 00:49:29 -07:00
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
feed('<c-w>+')
|
|
|
|
|
feed(':set laststatus<cr>')
|
|
|
|
|
screen:expect({
|
|
|
|
|
grid = [[
|
2022-04-30 00:49:29 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*11
|
2022-05-15 09:34:44 -07:00
|
|
|
|
────────────────────────────────────────────────────────────────────────────────|
|
2022-04-30 00:49:29 -07:00
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*9
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{3:[No Name] }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{ content = { { ' laststatus=3' } }, kind = '' },
|
|
|
|
|
},
|
|
|
|
|
})
|
2022-04-30 00:49:29 -07:00
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
feed(':set mouse=a<cr>')
|
2024-01-12 10:59:57 -07:00
|
|
|
|
api.nvim_input_mouse('left', 'press', '', 0, 12, 10)
|
2022-04-30 00:49:29 -07:00
|
|
|
|
poke_eventloop()
|
2024-01-12 10:59:57 -07:00
|
|
|
|
api.nvim_input_mouse('left', 'drag', '', 0, 11, 10)
|
2024-01-02 18:09:18 -07:00
|
|
|
|
feed('<c-l>')
|
|
|
|
|
feed(':set cmdheight<cr>')
|
|
|
|
|
screen:expect({
|
|
|
|
|
grid = [[
|
2022-04-30 00:49:29 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*10
|
2022-05-15 09:34:44 -07:00
|
|
|
|
────────────────────────────────────────────────────────────────────────────────|
|
2022-04-30 00:49:29 -07:00
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*10
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{3:[No Name] }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
messages = {
|
|
|
|
|
{ content = { { ' cmdheight=0' } }, kind = '' },
|
|
|
|
|
},
|
|
|
|
|
})
|
2022-04-30 00:49:29 -07:00
|
|
|
|
end)
|
2017-10-31 08:46:02 -07:00
|
|
|
|
end)
|
2019-06-07 20:55:19 -07:00
|
|
|
|
|
2024-03-15 01:23:18 -07:00
|
|
|
|
it('ui/ext_multigrid supports intro screen', function()
|
|
|
|
|
clear { args_rm = { '--headless' }, args = { '--cmd', 'set shortmess-=I' } }
|
|
|
|
|
local screen = Screen.new(80, 24)
|
|
|
|
|
screen:attach({ rgb = true, ext_multigrid = true })
|
|
|
|
|
|
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
|
|
|
|
## grid 1
|
|
|
|
|
[2:--------------------------------------------------------------------------------]|*23
|
|
|
|
|
[3:--------------------------------------------------------------------------------]|
|
|
|
|
|
## grid 2
|
|
|
|
|
^ |
|
|
|
|
|
{1:~ }|*4
|
|
|
|
|
{MATCH:.*}|
|
|
|
|
|
{1:~ }|
|
|
|
|
|
{1:~ }Nvim is open source and freely distributable{1: }|
|
|
|
|
|
{1:~ }https://neovim.io/#chat{1: }|
|
|
|
|
|
{1:~ }|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{1:~ }type :help nvim{18:<Enter>} if you are new! {1: }|
|
|
|
|
|
{1:~ }type :checkhealth{18:<Enter>} to optimize Nvim{1: }|
|
|
|
|
|
{1:~ }type :q{18:<Enter>} to exit {1: }|
|
|
|
|
|
{1:~ }type :help{18:<Enter>} for help {1: }|
|
2024-03-15 01:23:18 -07:00
|
|
|
|
{1:~ }|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{1:~{MATCH: +}}type :help news{18:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}|
|
2024-03-15 01:23:18 -07:00
|
|
|
|
{1:~ }|
|
2024-03-15 14:39:34 -07:00
|
|
|
|
{1:~ }Help poor children in Uganda!{1: }|
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{1:~ }type :help iccf{18:<Enter>} for information {1: }|
|
2024-03-15 01:23:18 -07:00
|
|
|
|
{1:~ }|*4
|
|
|
|
|
## grid 3
|
|
|
|
|
|
|
|
|
|
|
]],
|
|
|
|
|
win_viewport = {
|
|
|
|
|
[2] = {
|
|
|
|
|
win = 1000,
|
|
|
|
|
topline = 0,
|
|
|
|
|
botline = 2,
|
|
|
|
|
curline = 0,
|
|
|
|
|
curcol = 0,
|
|
|
|
|
linecount = 1,
|
|
|
|
|
sum_scroll_delta = 0,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
feed 'ix'
|
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
|
|
|
|
## grid 1
|
|
|
|
|
[2:--------------------------------------------------------------------------------]|*23
|
|
|
|
|
[3:--------------------------------------------------------------------------------]|
|
|
|
|
|
## grid 2
|
|
|
|
|
x^ |
|
|
|
|
|
{1:~ }|*22
|
|
|
|
|
## grid 3
|
2024-04-04 02:26:39 -07:00
|
|
|
|
{5:-- INSERT --} |
|
2024-03-15 01:23:18 -07:00
|
|
|
|
]],
|
|
|
|
|
win_viewport = {
|
|
|
|
|
[2] = {
|
|
|
|
|
win = 1000,
|
|
|
|
|
topline = 0,
|
|
|
|
|
botline = 2,
|
|
|
|
|
curline = 0,
|
|
|
|
|
curcol = 1,
|
|
|
|
|
linecount = 1,
|
|
|
|
|
sum_scroll_delta = 0,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
end)
|
|
|
|
|
|
2019-06-07 20:55:19 -07:00
|
|
|
|
describe('ui/msg_puts_printf', function()
|
|
|
|
|
it('output multibyte characters correctly', function()
|
|
|
|
|
local screen
|
|
|
|
|
local cmd = ''
|
2024-01-02 18:09:18 -07:00
|
|
|
|
local locale_dir = test_build_dir .. '/share/locale/ja/LC_MESSAGES'
|
2019-06-07 20:55:19 -07:00
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
clear({ env = { LANG = 'ja_JP.UTF-8' } })
|
2019-06-07 20:55:19 -07:00
|
|
|
|
screen = Screen.new(25, 5)
|
|
|
|
|
screen:attach()
|
|
|
|
|
|
2022-11-21 17:13:30 -07:00
|
|
|
|
if is_os('win') then
|
2019-06-07 20:55:19 -07:00
|
|
|
|
if os.execute('chcp 932 > NUL 2>&1') ~= 0 then
|
2019-06-09 03:02:52 -07:00
|
|
|
|
pending('missing japanese language features', function() end)
|
2019-06-07 20:55:19 -07:00
|
|
|
|
return
|
|
|
|
|
else
|
2024-03-19 17:02:50 -07:00
|
|
|
|
cmd = 'chcp 932 > NUL & '
|
2019-06-07 20:55:19 -07:00
|
|
|
|
end
|
|
|
|
|
else
|
2024-01-02 18:09:18 -07:00
|
|
|
|
if exc_exec('lang ja_JP.UTF-8') ~= 0 then
|
2019-06-09 03:02:52 -07:00
|
|
|
|
pending('Locale ja_JP.UTF-8 not supported', function() end)
|
|
|
|
|
return
|
2019-06-07 20:55:19 -07:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
os.execute('cmake -E make_directory ' .. locale_dir)
|
|
|
|
|
os.execute(
|
|
|
|
|
'cmake -E copy ' .. test_build_dir .. '/src/nvim/po/ja.mo ' .. locale_dir .. '/nvim.mo'
|
|
|
|
|
)
|
2019-06-09 03:02:52 -07:00
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
cmd = cmd .. '"' .. nvim_prog .. '" -u NONE -i NONE -Es -V1'
|
|
|
|
|
command([[call termopen(']] .. cmd .. [[')]])
|
2019-06-07 20:55:19 -07:00
|
|
|
|
screen:expect([[
|
2024-03-15 23:50:52 -07:00
|
|
|
|
^Exモードに入ります。ノー |
|
|
|
|
|
マルモードに戻るには "vis|
|
|
|
|
|
ual" と入力してください。|
|
2019-06-07 20:55:19 -07:00
|
|
|
|
: |
|
|
|
|
|
|
|
|
|
|
|
]])
|
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
os.execute('cmake -E remove_directory ' .. test_build_dir .. '/share')
|
2019-06-07 20:55:19 -07:00
|
|
|
|
end)
|
|
|
|
|
end)
|
2019-09-04 04:13:39 -07:00
|
|
|
|
|
|
|
|
|
describe('pager', function()
|
|
|
|
|
local screen
|
|
|
|
|
|
|
|
|
|
before_each(function()
|
|
|
|
|
clear()
|
2019-09-04 14:54:20 -07:00
|
|
|
|
screen = Screen.new(35, 8)
|
2019-09-04 04:13:39 -07:00
|
|
|
|
screen:attach()
|
|
|
|
|
screen:set_default_attr_ids({
|
2024-01-02 18:09:18 -07:00
|
|
|
|
[1] = { bold = true, foreground = Screen.colors.Blue1 },
|
|
|
|
|
[2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
|
|
|
|
|
[3] = {
|
|
|
|
|
foreground = Screen.colors.Grey100,
|
|
|
|
|
background = Screen.colors.Red,
|
|
|
|
|
special = Screen.colors.Yellow,
|
|
|
|
|
},
|
|
|
|
|
[4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
|
|
|
|
|
[5] = { special = Screen.colors.Yellow },
|
|
|
|
|
[6] = { special = Screen.colors.Yellow, bold = true, foreground = Screen.colors.SeaGreen4 },
|
|
|
|
|
[7] = { foreground = Screen.colors.Grey0, background = Screen.colors.Grey100 },
|
|
|
|
|
[8] = { foreground = Screen.colors.Gray90, background = Screen.colors.Grey100 },
|
|
|
|
|
[9] = { foreground = tonumber('0x00000c'), background = Screen.colors.Grey100 },
|
|
|
|
|
[10] = { background = Screen.colors.Grey100, bold = true, foreground = tonumber('0xe5e5ff') },
|
|
|
|
|
[11] = { background = Screen.colors.Grey100, bold = true, foreground = tonumber('0x2b8452') },
|
|
|
|
|
[12] = { bold = true, reverse = true },
|
2019-09-04 04:13:39 -07:00
|
|
|
|
})
|
2024-01-02 18:09:18 -07:00
|
|
|
|
command('set more')
|
2019-09-04 14:54:20 -07:00
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
exec_lua(
|
|
|
|
|
'_G.x = ...',
|
|
|
|
|
[[
|
2019-09-04 14:54:20 -07:00
|
|
|
|
Lorem ipsum dolor sit amet, consectetur
|
|
|
|
|
adipisicing elit, sed do eiusmod tempor
|
|
|
|
|
incididunt ut labore et dolore magna aliqua.
|
|
|
|
|
Ut enim ad minim veniam, quis nostrud xercitation
|
|
|
|
|
ullamco laboris nisi ut
|
2024-01-02 18:09:18 -07:00
|
|
|
|
aliquip ex ea commodo consequat.]]
|
|
|
|
|
)
|
2019-09-04 04:13:39 -07:00
|
|
|
|
end)
|
|
|
|
|
|
2022-06-12 16:45:44 -07:00
|
|
|
|
it('can be quit with echon', function()
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:try_resize(25, 5)
|
2019-10-19 14:45:27 -07:00
|
|
|
|
feed(':echon join(map(range(0, &lines*10), "v:val"), "\\n")<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-09-04 04:13:39 -07:00
|
|
|
|
0 |
|
|
|
|
|
1 |
|
|
|
|
|
2 |
|
|
|
|
|
3 |
|
|
|
|
|
{4:-- More --}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 04:13:39 -07:00
|
|
|
|
feed('q')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-09-04 04:13:39 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2019-09-04 04:13:39 -07:00
|
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 04:13:39 -07:00
|
|
|
|
end)
|
2019-09-04 14:54:20 -07:00
|
|
|
|
|
2022-06-12 16:45:44 -07:00
|
|
|
|
it('can be quit with Lua #11224 #16537', function()
|
|
|
|
|
-- NOTE: adds "4" to message history, although not displayed initially
|
|
|
|
|
-- (triggered the more prompt).
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:try_resize(40, 5)
|
2022-06-12 16:45:44 -07:00
|
|
|
|
feed(':lua for i=0,10 do print(i) end<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2022-06-12 16:45:44 -07:00
|
|
|
|
0 |
|
|
|
|
|
1 |
|
|
|
|
|
2 |
|
|
|
|
|
3 |
|
|
|
|
|
{4:-- More --}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2022-06-12 16:45:44 -07:00
|
|
|
|
feed('q')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2022-06-12 16:45:44 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2022-06-12 16:45:44 -07:00
|
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2022-06-12 16:45:44 -07:00
|
|
|
|
feed(':mess<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2022-06-12 16:45:44 -07:00
|
|
|
|
0 |
|
|
|
|
|
1 |
|
|
|
|
|
2 |
|
|
|
|
|
3 |
|
|
|
|
|
{4:-- More --}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2022-06-12 16:45:44 -07:00
|
|
|
|
feed('j')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2022-06-12 16:45:44 -07:00
|
|
|
|
1 |
|
|
|
|
|
2 |
|
|
|
|
|
3 |
|
|
|
|
|
4 |
|
|
|
|
|
{4:Press ENTER or type command to continue}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2022-06-12 16:45:44 -07:00
|
|
|
|
feed('<cr>')
|
|
|
|
|
end)
|
|
|
|
|
|
2019-09-04 14:54:20 -07:00
|
|
|
|
it('handles wrapped lines with line scroll', function()
|
|
|
|
|
feed(':lua error(_G.x)<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:E5108: Error executing lua [string }|
|
|
|
|
|
{2:":lua"]:1: Lorem ipsum dolor sit am}|
|
|
|
|
|
{2:et, consectetur} |
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{2:adipisicing elit, sed do eiusmod te}|
|
|
|
|
|
{2:mpor} |
|
|
|
|
|
{2:incididunt ut labore et dolore magn}|
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:a aliqua.} |
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{4:-- More --}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
|
|
|
|
|
feed('j')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:":lua"]:1: Lorem ipsum dolor sit am}|
|
|
|
|
|
{2:et, consectetur} |
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{2:adipisicing elit, sed do eiusmod te}|
|
|
|
|
|
{2:mpor} |
|
|
|
|
|
{2:incididunt ut labore et dolore magn}|
|
|
|
|
|
{2:a aliqua.} |
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:Ut enim ad minim veniam, quis nostr}|
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{4:-- More --}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
|
|
|
|
|
feed('k')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:E5108: Error executing lua [string }|
|
|
|
|
|
{2:":lua"]:1: Lorem ipsum dolor sit am}|
|
|
|
|
|
{2:et, consectetur} |
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{2:adipisicing elit, sed do eiusmod te}|
|
|
|
|
|
{2:mpor} |
|
|
|
|
|
{2:incididunt ut labore et dolore magn}|
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:a aliqua.} |
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{4:-- More --}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
|
|
|
|
|
feed('j')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:":lua"]:1: Lorem ipsum dolor sit am}|
|
|
|
|
|
{2:et, consectetur} |
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{2:adipisicing elit, sed do eiusmod te}|
|
|
|
|
|
{2:mpor} |
|
|
|
|
|
{2:incididunt ut labore et dolore magn}|
|
|
|
|
|
{2:a aliqua.} |
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:Ut enim ad minim veniam, quis nostr}|
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{4:-- More --}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
it('handles wrapped lines with page scroll', function()
|
|
|
|
|
feed(':lua error(_G.x)<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:E5108: Error executing lua [string }|
|
|
|
|
|
{2:":lua"]:1: Lorem ipsum dolor sit am}|
|
|
|
|
|
{2:et, consectetur} |
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{2:adipisicing elit, sed do eiusmod te}|
|
|
|
|
|
{2:mpor} |
|
|
|
|
|
{2:incididunt ut labore et dolore magn}|
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:a aliqua.} |
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{4:-- More --}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
feed('d')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2021-11-06 07:26:10 -07:00
|
|
|
|
{2:mpor} |
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{2:incididunt ut labore et dolore magn}|
|
|
|
|
|
{2:a aliqua.} |
|
|
|
|
|
{2:Ut enim ad minim veniam, quis nostr}|
|
|
|
|
|
{2:ud xercitation} |
|
|
|
|
|
{2:ullamco laboris nisi ut} |
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:aliquip ex ea commodo consequat.} |
|
2021-11-06 07:26:10 -07:00
|
|
|
|
{4:-- More --}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
feed('u')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:E5108: Error executing lua [string }|
|
|
|
|
|
{2:":lua"]:1: Lorem ipsum dolor sit am}|
|
|
|
|
|
{2:et, consectetur} |
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{2:adipisicing elit, sed do eiusmod te}|
|
|
|
|
|
{2:mpor} |
|
|
|
|
|
{2:incididunt ut labore et dolore magn}|
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:a aliqua.} |
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{4:-- More --}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
feed('d')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{2:mpor} |
|
|
|
|
|
{2:incididunt ut labore et dolore magn}|
|
|
|
|
|
{2:a aliqua.} |
|
|
|
|
|
{2:Ut enim ad minim veniam, quis nostr}|
|
|
|
|
|
{2:ud xercitation} |
|
|
|
|
|
{2:ullamco laboris nisi ut} |
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:aliquip ex ea commodo consequat.} |
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{4:-- More --}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
it('handles wrapped lines with line scroll and MsgArea highlight', function()
|
2024-01-02 18:09:18 -07:00
|
|
|
|
command('hi MsgArea guisp=Yellow')
|
2019-09-04 14:54:20 -07:00
|
|
|
|
|
|
|
|
|
feed(':lua error(_G.x)<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{3:E5108: Error executing lua [string }|
|
|
|
|
|
{3:":lua"]:1: Lorem ipsum dolor sit am}|
|
|
|
|
|
{3:et, consectetur}{5: }|
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{3:adipisicing elit, sed do eiusmod te}|
|
|
|
|
|
{3:mpor}{5: }|
|
|
|
|
|
{3:incididunt ut labore et dolore magn}|
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{3:a aliqua.}{5: }|
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{6:-- More --}{5:^ }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
|
|
|
|
|
feed('j')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{3:":lua"]:1: Lorem ipsum dolor sit am}|
|
|
|
|
|
{3:et, consectetur}{5: }|
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{3:adipisicing elit, sed do eiusmod te}|
|
|
|
|
|
{3:mpor}{5: }|
|
|
|
|
|
{3:incididunt ut labore et dolore magn}|
|
|
|
|
|
{3:a aliqua.}{5: }|
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{3:Ut enim ad minim veniam, quis nostr}|
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{6:-- More --}{5:^ }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
|
|
|
|
|
feed('k')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{3:E5108: Error executing lua [string }|
|
|
|
|
|
{3:":lua"]:1: Lorem ipsum dolor sit am}|
|
|
|
|
|
{3:et, consectetur}{5: }|
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{3:adipisicing elit, sed do eiusmod te}|
|
|
|
|
|
{3:mpor}{5: }|
|
|
|
|
|
{3:incididunt ut labore et dolore magn}|
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{3:a aliqua.}{5: }|
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{6:-- More --}{5:^ }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
|
|
|
|
|
feed('j')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{3:":lua"]:1: Lorem ipsum dolor sit am}|
|
|
|
|
|
{3:et, consectetur}{5: }|
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{3:adipisicing elit, sed do eiusmod te}|
|
|
|
|
|
{3:mpor}{5: }|
|
|
|
|
|
{3:incididunt ut labore et dolore magn}|
|
|
|
|
|
{3:a aliqua.}{5: }|
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{3:Ut enim ad minim veniam, quis nostr}|
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{6:-- More --}{5:^ }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
it('handles wrapped lines with page scroll and MsgArea highlight', function()
|
2024-01-02 18:09:18 -07:00
|
|
|
|
command('hi MsgArea guisp=Yellow')
|
2019-09-04 14:54:20 -07:00
|
|
|
|
feed(':lua error(_G.x)<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{3:E5108: Error executing lua [string }|
|
|
|
|
|
{3:":lua"]:1: Lorem ipsum dolor sit am}|
|
|
|
|
|
{3:et, consectetur}{5: }|
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{3:adipisicing elit, sed do eiusmod te}|
|
|
|
|
|
{3:mpor}{5: }|
|
|
|
|
|
{3:incididunt ut labore et dolore magn}|
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{3:a aliqua.}{5: }|
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{6:-- More --}{5:^ }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
feed('d')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2021-11-06 07:26:10 -07:00
|
|
|
|
{3:mpor}{5: }|
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{3:incididunt ut labore et dolore magn}|
|
|
|
|
|
{3:a aliqua.}{5: }|
|
|
|
|
|
{3:Ut enim ad minim veniam, quis nostr}|
|
|
|
|
|
{3:ud xercitation}{5: }|
|
|
|
|
|
{3:ullamco laboris nisi ut}{5: }|
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{3:aliquip ex ea commodo consequat.}{5: }|
|
2021-11-06 07:26:10 -07:00
|
|
|
|
{6:-- More --}{5:^ }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
feed('u')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{3:E5108: Error executing lua [string }|
|
|
|
|
|
{3:":lua"]:1: Lorem ipsum dolor sit am}|
|
|
|
|
|
{3:et, consectetur}{5: }|
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{3:adipisicing elit, sed do eiusmod te}|
|
|
|
|
|
{3:mpor}{5: }|
|
|
|
|
|
{3:incididunt ut labore et dolore magn}|
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{3:a aliqua.}{5: }|
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{6:-- More --}{5:^ }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
feed('d')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{3:mpor}{5: }|
|
|
|
|
|
{3:incididunt ut labore et dolore magn}|
|
|
|
|
|
{3:a aliqua.}{5: }|
|
|
|
|
|
{3:Ut enim ad minim veniam, quis nostr}|
|
|
|
|
|
{3:ud xercitation}{5: }|
|
|
|
|
|
{3:ullamco laboris nisi ut}{5: }|
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{3:aliquip ex ea commodo consequat.}{5: }|
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{6:-- More --}{5:^ }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
it('preserves MsgArea highlighting after more prompt', function()
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:try_resize(70, 6)
|
|
|
|
|
command('hi MsgArea guisp=Yellow')
|
|
|
|
|
command('map x Lorem ipsum labore et dolore magna aliqua')
|
|
|
|
|
command('map y adipisicing elit')
|
|
|
|
|
command('map z incididunt ut')
|
|
|
|
|
command('map a labore et dolore')
|
|
|
|
|
command('map b ex ea commodo')
|
|
|
|
|
command('map xx yy')
|
|
|
|
|
command('map xy yz')
|
2019-09-04 14:54:20 -07:00
|
|
|
|
feed(':map<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{5: a labore et dolore }|
|
|
|
|
|
{5: b ex ea commodo }|
|
|
|
|
|
{5: xy yz }|
|
|
|
|
|
{5: xx yy }|
|
|
|
|
|
{5: x Lorem ipsum labore et dolore magna aliqua }|
|
|
|
|
|
{6:-- More --}{5:^ }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
feed('j')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{5: b ex ea commodo }|
|
|
|
|
|
{5: xy yz }|
|
|
|
|
|
{5: xx yy }|
|
|
|
|
|
{5: x Lorem ipsum labore et dolore magna aliqua }|
|
|
|
|
|
{5: y adipisicing elit }|
|
|
|
|
|
{6:-- More --}{5:^ }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
feed('j')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{5: xy yz }|
|
|
|
|
|
{5: xx yy }|
|
|
|
|
|
{5: x Lorem ipsum labore et dolore magna aliqua }|
|
|
|
|
|
{5: y adipisicing elit }|
|
|
|
|
|
{5: z incididunt ut }|
|
|
|
|
|
{6:Press ENTER or type command to continue}{5:^ }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
it('clears "-- more --" message', function()
|
2024-01-02 18:09:18 -07:00
|
|
|
|
command('hi MsgArea guisp=Yellow blend=10')
|
2019-09-04 14:54:20 -07:00
|
|
|
|
feed(':echon join(range(20), "\\n")<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{7:0}{8: }|
|
|
|
|
|
{9:1}{10: }|
|
|
|
|
|
{9:2}{10: }|
|
|
|
|
|
{9:3}{10: }|
|
|
|
|
|
{9:4}{10: }|
|
|
|
|
|
{9:5}{10: }|
|
|
|
|
|
{9:6}{10: }|
|
|
|
|
|
{11:--}{8: }{11:More}{8: }{11:--}{8:^ }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
|
|
|
|
|
feed('j')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{7:1}{8: }|
|
|
|
|
|
{9:2}{10: }|
|
|
|
|
|
{9:3}{10: }|
|
|
|
|
|
{9:4}{10: }|
|
|
|
|
|
{9:5}{10: }|
|
|
|
|
|
{9:6}{10: }|
|
|
|
|
|
{9:7}{10: }|
|
|
|
|
|
{11:--}{8: }{11:More}{8: }{11:--}{8:^ }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
|
|
|
|
|
feed('k')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2022-07-25 16:30:33 -07:00
|
|
|
|
{7:0}{8: }|
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{9:1}{10: }|
|
|
|
|
|
{9:2}{10: }|
|
|
|
|
|
{9:3}{10: }|
|
|
|
|
|
{9:4}{10: }|
|
|
|
|
|
{9:5}{10: }|
|
|
|
|
|
{9:6}{10: }|
|
|
|
|
|
{11:--}{8: }{11:More}{8: }{11:--}{8:^ }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
|
|
|
|
|
feed('j')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-09-04 14:54:20 -07:00
|
|
|
|
{7:1}{8: }|
|
|
|
|
|
{9:2}{10: }|
|
|
|
|
|
{9:3}{10: }|
|
|
|
|
|
{9:4}{10: }|
|
|
|
|
|
{9:5}{10: }|
|
|
|
|
|
{9:6}{10: }|
|
|
|
|
|
{9:7}{10: }|
|
|
|
|
|
{11:--}{8: }{11:More}{8: }{11:--}{8:^ }|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-04 14:54:20 -07:00
|
|
|
|
end)
|
2019-09-08 05:57:45 -07:00
|
|
|
|
|
|
|
|
|
it('with :!cmd does not crash on resize', function()
|
2024-01-12 10:59:57 -07:00
|
|
|
|
skip(fn.executable('sleep') == 0, 'missing "sleep" command')
|
2019-09-08 05:57:45 -07:00
|
|
|
|
feed(':!sleep 1<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-09-08 05:57:45 -07:00
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*4
|
2019-09-08 05:57:45 -07:00
|
|
|
|
{12: }|
|
|
|
|
|
:!sleep 1 |
|
|
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-08 05:57:45 -07:00
|
|
|
|
|
|
|
|
|
-- not processed while command is executing
|
2024-01-15 09:10:51 -07:00
|
|
|
|
async_meths.nvim_ui_try_resize(35, 5)
|
2019-09-08 05:57:45 -07:00
|
|
|
|
|
|
|
|
|
-- TODO(bfredl): ideally it should be processed just
|
|
|
|
|
-- before the "press ENTER" prompt though
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-09-08 05:57:45 -07:00
|
|
|
|
|
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*2
|
2019-09-08 05:57:45 -07:00
|
|
|
|
{12: }|
|
|
|
|
|
:!sleep 1 |
|
|
|
|
|
|
|
|
|
|
|
{4:Press ENTER or type command to cont}|
|
|
|
|
|
{4:inue}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-08 05:57:45 -07:00
|
|
|
|
|
|
|
|
|
feed('<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-09-08 05:57:45 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*3
|
2019-09-08 05:57:45 -07:00
|
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-08 05:57:45 -07:00
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
it('can be resized', function()
|
|
|
|
|
feed(':lua error(_G.x)<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:E5108: Error executing lua [string }|
|
|
|
|
|
{2:":lua"]:1: Lorem ipsum dolor sit am}|
|
|
|
|
|
{2:et, consectetur} |
|
2019-09-08 05:57:45 -07:00
|
|
|
|
{2:adipisicing elit, sed do eiusmod te}|
|
|
|
|
|
{2:mpor} |
|
|
|
|
|
{2:incididunt ut labore et dolore magn}|
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:a aliqua.} |
|
2019-09-08 05:57:45 -07:00
|
|
|
|
{4:-- More --}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-08 05:57:45 -07:00
|
|
|
|
|
|
|
|
|
-- responds to resize, but text is not reflown
|
|
|
|
|
screen:try_resize(45, 5)
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-09-08 05:57:45 -07:00
|
|
|
|
{2:adipisicing elit, sed do eiusmod te} |
|
|
|
|
|
{2:mpor} |
|
|
|
|
|
{2:incididunt ut labore et dolore magn} |
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:a aliqua.} |
|
2019-09-08 05:57:45 -07:00
|
|
|
|
{4:-- More --}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-08 05:57:45 -07:00
|
|
|
|
|
|
|
|
|
-- can create empty space, as the command hasn't output the text below yet.
|
|
|
|
|
-- text is not reflown; existing lines get cut
|
|
|
|
|
screen:try_resize(30, 12)
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2022-07-25 16:30:33 -07:00
|
|
|
|
:lua error(_G.x) |
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:E5108: Error executing lua [st}|
|
|
|
|
|
{2:":lua"]:1: Lorem ipsum dolor s}|
|
|
|
|
|
{2:et, consectetur} |
|
2019-09-08 05:57:45 -07:00
|
|
|
|
{2:adipisicing elit, sed do eiusm}|
|
|
|
|
|
{2:mpore} |
|
|
|
|
|
{2:incididunt ut labore et dolore}|
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:a aliqua.} |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
|*3
|
2019-09-08 05:57:45 -07:00
|
|
|
|
{4:-- More --}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-08 05:57:45 -07:00
|
|
|
|
|
|
|
|
|
-- continues in a mostly consistent state, but only new lines are
|
|
|
|
|
-- wrapped at the new screen size.
|
2022-07-25 16:30:33 -07:00
|
|
|
|
feed('<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2022-07-25 16:30:33 -07:00
|
|
|
|
{2:E5108: Error executing lua [st}|
|
|
|
|
|
{2:":lua"]:1: Lorem ipsum dolor s}|
|
|
|
|
|
{2:et, consectetur} |
|
|
|
|
|
{2:adipisicing elit, sed do eiusm}|
|
|
|
|
|
{2:mpore} |
|
|
|
|
|
{2:incididunt ut labore et dolore}|
|
|
|
|
|
{2:a aliqua.} |
|
|
|
|
|
{2:Ut enim ad minim veniam, quis }|
|
|
|
|
|
{2:nostrud xercitation} |
|
|
|
|
|
{2:ullamco laboris nisi ut} |
|
|
|
|
|
{2:aliquip ex ea commodo consequa}|
|
|
|
|
|
{4:-- More --}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2022-07-25 16:30:33 -07:00
|
|
|
|
|
2019-09-08 05:57:45 -07:00
|
|
|
|
feed('<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2021-11-06 07:26:10 -07:00
|
|
|
|
{2:":lua"]:1: Lorem ipsum dolor s}|
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:et, consectetur} |
|
2019-09-08 05:57:45 -07:00
|
|
|
|
{2:adipisicing elit, sed do eiusm}|
|
|
|
|
|
{2:mpore} |
|
|
|
|
|
{2:incididunt ut labore et dolore}|
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:a aliqua.} |
|
2019-09-08 05:57:45 -07:00
|
|
|
|
{2:Ut enim ad minim veniam, quis }|
|
|
|
|
|
{2:nostrud xercitation} |
|
|
|
|
|
{2:ullamco laboris nisi ut} |
|
|
|
|
|
{2:aliquip ex ea commodo consequa}|
|
2019-10-30 12:53:09 -07:00
|
|
|
|
{2:t.} |
|
2021-11-06 07:26:10 -07:00
|
|
|
|
{4:-- More --}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-08 05:57:45 -07:00
|
|
|
|
|
|
|
|
|
feed('q')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2019-09-08 05:57:45 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*10
|
2019-09-08 05:57:45 -07:00
|
|
|
|
|
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2019-09-08 05:57:45 -07:00
|
|
|
|
end)
|
2022-09-16 01:31:37 -07:00
|
|
|
|
|
|
|
|
|
it('with cmdheight=0 does not crash with g<', function()
|
|
|
|
|
command('set cmdheight=0')
|
|
|
|
|
feed(':ls<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2022-09-16 01:31:37 -07:00
|
|
|
|
|
|
|
|
|
|
{1:~ }|
|
|
|
|
|
{12: }|
|
|
|
|
|
:ls |
|
|
|
|
|
1 %a "[No Name]" |
|
|
|
|
|
line 1 |
|
|
|
|
|
{4:Press ENTER or type command to cont}|
|
|
|
|
|
{4:inue}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2022-09-16 01:31:37 -07:00
|
|
|
|
|
|
|
|
|
feed('<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2022-09-16 01:31:37 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*7
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2022-09-16 01:31:37 -07:00
|
|
|
|
|
|
|
|
|
feed('g<lt>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2022-09-16 01:31:37 -07:00
|
|
|
|
|
|
|
|
|
|
{1:~ }|
|
|
|
|
|
{12: }|
|
|
|
|
|
:ls |
|
|
|
|
|
1 %a "[No Name]" |
|
|
|
|
|
line 1 |
|
|
|
|
|
{4:Press ENTER or type command to cont}|
|
|
|
|
|
{4:inue}^ |
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2022-09-16 01:31:37 -07:00
|
|
|
|
|
|
|
|
|
feed('<cr>')
|
2024-01-02 18:09:18 -07:00
|
|
|
|
screen:expect {
|
|
|
|
|
grid = [[
|
2022-09-16 01:31:37 -07:00
|
|
|
|
^ |
|
2023-12-09 05:42:00 -07:00
|
|
|
|
{1:~ }|*7
|
2024-01-02 18:09:18 -07:00
|
|
|
|
]],
|
|
|
|
|
}
|
2022-09-16 01:31:37 -07:00
|
|
|
|
end)
|
2024-03-18 07:25:55 -07:00
|
|
|
|
|
|
|
|
|
it('g< shows blank line from :echo properly', function()
|
|
|
|
|
screen:try_resize(60, 8)
|
|
|
|
|
feed([[:echo 1 | echo "\n" | echo 2<CR>]])
|
|
|
|
|
screen:expect([[
|
|
|
|
|
|
|
|
|
|
|
{1:~ }|*2
|
|
|
|
|
{12: }|
|
|
|
|
|
1 |
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
{4:Press ENTER or type command to continue}^ |
|
|
|
|
|
]])
|
|
|
|
|
|
|
|
|
|
feed('<CR>')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
^ |
|
|
|
|
|
{1:~ }|*6
|
|
|
|
|
|
|
|
|
|
|
]])
|
|
|
|
|
|
|
|
|
|
feed('g<lt>')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
|
|
|
|
|
|
{1:~ }|
|
|
|
|
|
{12: }|
|
|
|
|
|
:echo 1 | echo "\n" | echo 2 |
|
|
|
|
|
1 |
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
{4:Press ENTER or type command to continue}^ |
|
|
|
|
|
]])
|
|
|
|
|
|
|
|
|
|
feed('<CR>')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
^ |
|
|
|
|
|
{1:~ }|*6
|
|
|
|
|
|
|
|
|
|
|
]])
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
it('scrolling works properly when :echo output ends with newline', function()
|
|
|
|
|
screen:try_resize(60, 6)
|
|
|
|
|
feed([[:echo range(100)->join("\n") .. "\n"<CR>]])
|
|
|
|
|
screen:expect([[
|
|
|
|
|
0 |
|
|
|
|
|
1 |
|
|
|
|
|
2 |
|
|
|
|
|
3 |
|
|
|
|
|
4 |
|
|
|
|
|
{4:-- More --}^ |
|
|
|
|
|
]])
|
|
|
|
|
feed('G')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
96 |
|
|
|
|
|
97 |
|
|
|
|
|
98 |
|
|
|
|
|
99 |
|
|
|
|
|
|
|
|
|
|
|
{4:Press ENTER or type command to continue}^ |
|
|
|
|
|
]])
|
|
|
|
|
for _ = 1, 3 do
|
|
|
|
|
feed('k')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
95 |
|
|
|
|
|
96 |
|
|
|
|
|
97 |
|
|
|
|
|
98 |
|
|
|
|
|
99 |
|
|
|
|
|
{4:-- More --}^ |
|
|
|
|
|
]])
|
|
|
|
|
feed('k')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
94 |
|
|
|
|
|
95 |
|
|
|
|
|
96 |
|
|
|
|
|
97 |
|
|
|
|
|
98 |
|
|
|
|
|
{4:-- More --}^ |
|
|
|
|
|
]])
|
|
|
|
|
feed('j')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
95 |
|
|
|
|
|
96 |
|
|
|
|
|
97 |
|
|
|
|
|
98 |
|
|
|
|
|
99 |
|
|
|
|
|
{4:-- More --}^ |
|
|
|
|
|
]])
|
|
|
|
|
feed('j')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
96 |
|
|
|
|
|
97 |
|
|
|
|
|
98 |
|
|
|
|
|
99 |
|
|
|
|
|
|
|
|
|
|
|
{4:-- More --}^ |
|
|
|
|
|
]])
|
|
|
|
|
feed('j')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
96 |
|
|
|
|
|
97 |
|
|
|
|
|
98 |
|
|
|
|
|
99 |
|
|
|
|
|
|
|
|
|
|
|
{4:Press ENTER or type command to continue}^ |
|
|
|
|
|
]])
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
it('scrolling works properly when :!cmd output ends with newline #27902', function()
|
|
|
|
|
screen:try_resize(60, 6)
|
|
|
|
|
api.nvim_set_option_value('shell', testprg('shell-test'), {})
|
|
|
|
|
api.nvim_set_option_value('shellcmdflag', 'REP 100', {})
|
|
|
|
|
api.nvim_set_option_value('shellxquote', '', {}) -- win: avoid extra quotes
|
|
|
|
|
feed([[:!foo<CR>]])
|
|
|
|
|
screen:expect([[
|
|
|
|
|
96: foo |
|
|
|
|
|
97: foo |
|
|
|
|
|
98: foo |
|
|
|
|
|
99: foo |
|
|
|
|
|
|
|
|
|
|
|
{4:Press ENTER or type command to continue}^ |
|
|
|
|
|
]])
|
|
|
|
|
for _ = 1, 3 do
|
|
|
|
|
feed('k')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
95: foo |
|
|
|
|
|
96: foo |
|
|
|
|
|
97: foo |
|
|
|
|
|
98: foo |
|
|
|
|
|
99: foo |
|
|
|
|
|
{4:-- More --}^ |
|
|
|
|
|
]])
|
|
|
|
|
feed('k')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
94: foo |
|
|
|
|
|
95: foo |
|
|
|
|
|
96: foo |
|
|
|
|
|
97: foo |
|
|
|
|
|
98: foo |
|
|
|
|
|
{4:-- More --}^ |
|
|
|
|
|
]])
|
|
|
|
|
feed('j')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
95: foo |
|
|
|
|
|
96: foo |
|
|
|
|
|
97: foo |
|
|
|
|
|
98: foo |
|
|
|
|
|
99: foo |
|
|
|
|
|
{4:-- More --}^ |
|
|
|
|
|
]])
|
|
|
|
|
feed('j')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
96: foo |
|
|
|
|
|
97: foo |
|
|
|
|
|
98: foo |
|
|
|
|
|
99: foo |
|
|
|
|
|
|
|
|
|
|
|
{4:-- More --}^ |
|
|
|
|
|
]])
|
|
|
|
|
feed('j')
|
|
|
|
|
screen:expect([[
|
|
|
|
|
96: foo |
|
|
|
|
|
97: foo |
|
|
|
|
|
98: foo |
|
|
|
|
|
99: foo |
|
|
|
|
|
|
|
|
|
|
|
{4:Press ENTER or type command to continue}^ |
|
|
|
|
|
]])
|
|
|
|
|
end
|
|
|
|
|
end)
|
2019-09-04 04:13:39 -07:00
|
|
|
|
end)
|
2024-03-17 19:34:27 -07:00
|
|
|
|
|
|
|
|
|
it('pager works in headless mode with UI attached', function()
|
|
|
|
|
skip(is_os('win'))
|
|
|
|
|
clear()
|
2024-04-08 02:03:20 -07:00
|
|
|
|
local child_server = assert(t.new_pipename())
|
2024-03-17 19:34:27 -07:00
|
|
|
|
fn.jobstart({ nvim_prog, '--clean', '--headless', '--listen', child_server })
|
|
|
|
|
retry(nil, nil, function()
|
|
|
|
|
neq(nil, vim.uv.fs_stat(child_server))
|
|
|
|
|
end)
|
|
|
|
|
|
2024-04-08 02:03:20 -07:00
|
|
|
|
local child_session = t.connect(child_server)
|
2024-03-17 19:34:27 -07:00
|
|
|
|
local child_screen = Screen.new(40, 6)
|
|
|
|
|
child_screen:attach(nil, child_session)
|
2024-03-22 03:02:52 -07:00
|
|
|
|
child_screen._default_attr_ids = nil -- TODO: unskip with new color scheme
|
2024-03-17 19:34:27 -07:00
|
|
|
|
|
|
|
|
|
child_session:notify('nvim_command', [[echo range(100)->join("\n")]])
|
|
|
|
|
child_screen:expect([[
|
|
|
|
|
0 |
|
|
|
|
|
1 |
|
|
|
|
|
2 |
|
|
|
|
|
3 |
|
|
|
|
|
4 |
|
|
|
|
|
-- More --^ |
|
|
|
|
|
]])
|
|
|
|
|
|
|
|
|
|
child_session:request('nvim_input', 'G')
|
|
|
|
|
child_screen:expect([[
|
|
|
|
|
95 |
|
|
|
|
|
96 |
|
|
|
|
|
97 |
|
|
|
|
|
98 |
|
|
|
|
|
99 |
|
|
|
|
|
Press ENTER or type command to continue^ |
|
|
|
|
|
]])
|
|
|
|
|
|
|
|
|
|
child_session:request('nvim_input', 'g')
|
|
|
|
|
child_screen:expect([[
|
|
|
|
|
0 |
|
|
|
|
|
1 |
|
|
|
|
|
2 |
|
|
|
|
|
3 |
|
|
|
|
|
4 |
|
|
|
|
|
-- More --^ |
|
|
|
|
|
]])
|
|
|
|
|
end)
|