From 99bd89595675268498f782f4b81485bf6a88d4e8 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 22 Aug 2022 08:31:21 +0800 Subject: vim-patch:8.2.4328: command line complete matches cleard when typing character MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: Command line complete matches cleard when typing character. (Dominique Pellé) Solution: Only remove a popup menu if there is one. https://github.com/vim/vim/commit/73a16c22a4703cb9a7becdf459ce62bd894980d7 --- src/nvim/testdir/test_cmdline.vim | 9 +++++++++ test/functional/ui/popupmenu_spec.lua | 37 +++++++++++++++++++++++++++++++++-- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index 3f53ed04b6..b22607635e 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -2024,6 +2024,15 @@ func Test_wildmenu_pum() call TermWait(buf) call VerifyScreenDump(buf, 'Test_wildmenu_pum_29', {}) + " Check "list" still works + call term_sendkeys(buf, "\set wildmode=longest,list\") + call term_sendkeys(buf, ":cn\") + call TermWait(buf) + call VerifyScreenDump(buf, 'Test_wildmenu_pum_30', {}) + call term_sendkeys(buf, "s") + call TermWait(buf) + call VerifyScreenDump(buf, 'Test_wildmenu_pum_31', {}) + call term_sendkeys(buf, "\\") call StopVimInTerminal(buf) call delete('Xtest') diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua index f148e2643f..684f4a2909 100644 --- a/test/functional/ui/popupmenu_spec.lua +++ b/test/functional/ui/popupmenu_spec.lua @@ -2160,6 +2160,38 @@ describe('builtin popupmenu', function() feed('') + -- Check "list" still works + command('set wildmode=longest,list') + feed(':cn') + screen:expect([[ + | + {1:~ }| + {1:~ }| + {1:~ }| + {4: }| + :cn | + cnewer cnoreabbrev | + cnext cnoremap | + cnfile cnoremenu | + :cn^ | + ]]) + feed('s') + screen:expect([[ + | + {1:~ }| + {1:~ }| + {1:~ }| + {4: }| + :cn | + cnewer cnoreabbrev | + cnext cnoremap | + cnfile cnoremenu | + :cns^ | + ]]) + + feed('') + command('set wildmode=full') + -- check positioning with multibyte char in pattern command("e långfile1") command("sp långfile2") @@ -2229,11 +2261,12 @@ describe('builtin popupmenu', function() :b långfile^ | ]]) - -- special case: when patterns ends with "/", show menu items aligned - -- after the "/" feed('') command("close") command('set wildmode=full') + + -- special case: when patterns ends with "/", show menu items aligned + -- after the "/" feed(':e compdir/') screen:expect([[ | -- cgit From 06a53ab2cb13e1cc7d0deb3c8846881056aefbbf Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 22 Aug 2022 08:42:02 +0800 Subject: vim-patch:8.2.4334: command line popup menu not positioned correctly Problem: Command line popup menu not positioned correctly. Solution: Also use vim_strsize() on the existing text. (Naruhiko Nishino, closes vim/vim#9727) https://github.com/vim/vim/commit/68cc2b8a37197872e737fb61244069e13b7227a2 --- src/nvim/testdir/test_cmdline.vim | 11 +++++++++++ .../wildpum/\343\201\202\343\201\204\343\201\206/123" | 0 .../wildpum/\343\201\202\343\201\204\343\201\206/abc" | 0 .../wildpum/\343\201\202\343\201\204\343\201\206/xyz" | 0 test/functional/ui/popupmenu_spec.lua | 17 +++++++++++++++++ 5 files changed, 28 insertions(+) create mode 100644 "test/functional/fixtures/wildpum/\343\201\202\343\201\204\343\201\206/123" create mode 100644 "test/functional/fixtures/wildpum/\343\201\202\343\201\204\343\201\206/abc" create mode 100644 "test/functional/fixtures/wildpum/\343\201\202\343\201\204\343\201\206/xyz" diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index b22607635e..35886d42c5 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -2033,6 +2033,17 @@ func Test_wildmenu_pum() call TermWait(buf) call VerifyScreenDump(buf, 'Test_wildmenu_pum_31', {}) + " Tests a directory name contained full-width characters. + call mkdir('Xdir/あいう', 'p') + call writefile([], 'Xdir/あいう/abc') + call writefile([], 'Xdir/あいう/xyz') + call writefile([], 'Xdir/あいう/123') + + call term_sendkeys(buf, "\set wildmode&\") + call term_sendkeys(buf, ":\e Xdir/あいう/\") + call TermWait(buf) + call VerifyScreenDump(buf, 'Test_wildmenu_pum_32', {}) + call term_sendkeys(buf, "\\") call StopVimInTerminal(buf) call delete('Xtest') diff --git "a/test/functional/fixtures/wildpum/\343\201\202\343\201\204\343\201\206/123" "b/test/functional/fixtures/wildpum/\343\201\202\343\201\204\343\201\206/123" new file mode 100644 index 0000000000..e69de29bb2 diff --git "a/test/functional/fixtures/wildpum/\343\201\202\343\201\204\343\201\206/abc" "b/test/functional/fixtures/wildpum/\343\201\202\343\201\204\343\201\206/abc" new file mode 100644 index 0000000000..e69de29bb2 diff --git "a/test/functional/fixtures/wildpum/\343\201\202\343\201\204\343\201\206/xyz" "b/test/functional/fixtures/wildpum/\343\201\202\343\201\204\343\201\206/xyz" new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua index 684f4a2909..e11cd1e859 100644 --- a/test/functional/ui/popupmenu_spec.lua +++ b/test/functional/ui/popupmenu_spec.lua @@ -2192,6 +2192,23 @@ describe('builtin popupmenu', function() feed('') command('set wildmode=full') + -- Tests a directory name contained full-width characters. + feed(':e あいう/') + screen:expect([[ + | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }{s: 123 }{1: }| + {1:~ }{n: abc }{1: }| + {1:~ }{n: xyz }{1: }| + :e あいう/123^ | + ]]) + + feed('') + -- check positioning with multibyte char in pattern command("e långfile1") command("sp långfile2") -- cgit