diff options
author | zeertzjq <zeertzjq@outlook.com> | 2025-02-05 11:36:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-05 11:36:01 +0800 |
commit | aa976f0d932738cb4b4f7cf5bef3d5157c68232d (patch) | |
tree | 4350105bd7b037be046e542e8ab7d90bd433e43c /test/functional/ui/messages_spec.lua | |
parent | 1deb580977f4144ff3e4704765d13684e84405c5 (diff) | |
download | rneovim-aa976f0d932738cb4b4f7cf5bef3d5157c68232d.tar.gz rneovim-aa976f0d932738cb4b4f7cf5bef3d5157c68232d.tar.bz2 rneovim-aa976f0d932738cb4b4f7cf5bef3d5157c68232d.zip |
fix(messages): add a trailing space to inputlist() etc. prompts (#32328)
Before #31525 the prompts had a trailing space.
Also add a test for #7857.
Diffstat (limited to 'test/functional/ui/messages_spec.lua')
-rw-r--r-- | test/functional/ui/messages_spec.lua | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua index c996d117f2..5c55dfe910 100644 --- a/test/functional/ui/messages_spec.lua +++ b/test/functional/ui/messages_spec.lua @@ -1259,7 +1259,7 @@ stack traceback: content = { { '' } }, hl_id = 0, pos = 0, - prompt = 'Type number and <Enter> or click with the mouse (q or empty cancels):', + prompt = 'Type number and <Enter> or click with the mouse (q or empty cancels): ', }, }, messages = { @@ -1282,7 +1282,7 @@ stack traceback: content = { { '1' } }, hl_id = 0, pos = 1, - prompt = 'Type number and <Enter> or click with the mouse (q or empty cancels):', + prompt = 'Type number and <Enter> or click with the mouse (q or empty cancels): ', }, }, messages = { @@ -1302,6 +1302,41 @@ stack traceback: ]], cmdline = { { abort = false } }, }) + + async_meths.nvim_command("let g:n = inputlist(['input0', 'input1'])") + screen:expect({ + grid = [[ + ^Hello | + {1:~ }|*4 + ]], + cmdline = { + { + content = { { '' } }, + hl_id = 0, + pos = 0, + prompt = 'Type number and <Enter> or click with the mouse (q or empty cancels): ', + }, + }, + messages = { + { + content = { { 'input0\ninput1\n' } }, + history = false, + kind = 'list_cmd', + }, + }, + }) + + feed('42<CR>') + screen:expect({ + grid = [[ + ^Hello | + {1:~ }|*4 + ]], + cmdline = { { + abort = false, + } }, + }) + eq(42, eval('g:n')) end) it('supports nvim_echo messages with multiple attrs', function() |