From 6e3890f4ce002ba308c09166b00e8ee86b6efa03 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 19 Jan 2023 15:13:27 +0800 Subject: vim-patch:8.2.4655: cmdline completion popup menu positioned wrong (#21894) Problem: Command line completion popup menu positioned wrong when using a terminal window. Solution: Position the popup menu differently when editing the command line. (Yegappan Lakshmanan, closes vim/vim#10050, closes vim/vim#10035) https://github.com/vim/vim/commit/1104a6d0c2004d39e9b6cb8f804d12b628a69869 The test in the patch looks a bit hard to understand. Add a Lua test that is more straightforward. Co-authored-by: Yegappan Lakshmanan --- src/nvim/testdir/test_cmdline.vim | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index 980b8c5b38..150f4e01ef 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -2610,6 +2610,30 @@ func Test_wildmenumode_with_pum() cunmap endfunc +" Test for opening the cmdline completion popup menu from the terminal window. +" The popup menu should be positioned correctly over the status line of the +" bottom-most window. +func Test_wildmenu_pum_from_terminal() + CheckRunVimInTerminal + let python = PythonProg() + call CheckPython(python) + + %bw! + let cmds = ['set wildmenu wildoptions=pum'] + let pcmd = python .. ' -c "import sys; sys.stdout.write(sys.stdin.read())"' + call add(cmds, "call term_start('" .. pcmd .. "')") + call writefile(cmds, 'Xtest') + let buf = RunVimInTerminal('-S Xtest', #{rows: 10}) + call term_sendkeys(buf, "\r\r\r") + call term_wait(buf) + call term_sendkeys(buf, "\:sign \") + call term_wait(buf) + call VerifyScreenDump(buf, 'Test_wildmenu_pum_term_01', {}) + call term_wait(buf) + call StopVimInTerminal(buf) + call delete('Xtest') +endfunc + func Test_wildmenu_pum_clear_entries() CheckRunVimInTerminal -- cgit