From 1af1e918d30c062dfcb7d4ce2f4cfbca1d11e2ab Mon Sep 17 00:00:00 2001 From: glepnir Date: Sat, 30 Nov 2024 18:24:31 +0800 Subject: vim-patch:9.1.0896: completion list wrong after v9.1.0891 Problem: completion list wrong after v9.1.0891 Solution: update compl_mach_array after leader change (glepnir) compl_shown_match update not correct after refactoring in v9.1.0891 Unfortunately, this regressed what item is selected after leader change. So generate compl_match_array before updating compl_shown_match range, and split generate compl_match_array into range match_head fixes: https://github.com/vim/vim/issues/16128 closes: https://github.com/vim/vim/pull/16129 https://github.com/vim/vim/commit/a49c077a883b2566882df9069385ed1e1277ca64 --- test/old/testdir/test_popup.vim | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test') diff --git a/test/old/testdir/test_popup.vim b/test/old/testdir/test_popup.vim index 601ba6c688..33e86678c8 100644 --- a/test/old/testdir/test_popup.vim +++ b/test/old/testdir/test_popup.vim @@ -1675,4 +1675,29 @@ func Test_pum_completeitemalign() call StopVimInTerminal(buf) endfunc +func Test_pum_keep_select() + CheckScreendump + let lines =<< trim END + set completeopt=menu,menuone,noinsert + END + call writefile(lines, 'Xscript', 'D') + let buf = RunVimInTerminal('-S Xscript', {}) + call TermWait(buf) + + call term_sendkeys(buf, "ggSFab\Five\find\film\\\") + call TermWait(buf, 50) + call VerifyScreenDump(buf, 'Test_pum_keep_select_01', {}) + call term_sendkeys(buf, "\\") + call TermWait(buf, 50) + + call term_sendkeys(buf, "S\\") + call TermWait(buf, 50) + call term_sendkeys(buf, "F") + call VerifyScreenDump(buf, 'Test_pum_keep_select_02', {}) + call term_sendkeys(buf, "\\") + + call TermWait(buf, 50) + call StopVimInTerminal(buf) +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit