# HG changeset patch # User Bram Moolenaar # Date 1644408005 -3600 # Node ID a74901e9593725510983131a299b73bb9206d7fe # Parent 0d11933dc9e9262709d1f0ea0b9a2e953224e67b patch 8.2.4334: command line popup menu not positioned correctly Commit: https://github.com/vim/vim/commit/68cc2b8a37197872e737fb61244069e13b7227a2 Author: rbtnn Date: Wed Feb 9 11:55:47 2022 +0000 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 #9727) diff --git a/src/cmdexpand.c b/src/cmdexpand.c --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -622,7 +622,7 @@ showmatches(expand_T *xp, int wildmenu U compl_match_array[i].pum_extra = NULL; compl_match_array[i].pum_kind = NULL; } - compl_startcol = ccline->cmdpos + 1; + compl_startcol = vim_strsize(ccline->cmdbuff) + 1; columns = vim_strsize(xp->xp_pattern); if (showtail) { diff --git a/src/testdir/dumps/Test_wildmenu_pum_32.dump b/src/testdir/dumps/Test_wildmenu_pum_32.dump new file mode 100644 --- /dev/null +++ b/src/testdir/dumps/Test_wildmenu_pum_32.dump @@ -0,0 +1,10 @@ +| +0&#ffffff0@74 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @12| +0#0000001#e0e0e08|1|2|3| @11| +0#4040ff13#ffffff0@44 +|~| @12| +0#0000001#ffd7ff255|a|b|c| @11| +0#4040ff13#ffffff0@44 +|~| @12| +0#0000001#ffd7ff255|x|y|z| @11| +0#4040ff13#ffffff0@44 +|:+0#0000000&|e| |X|d|i|r|/|あ*&|い|う|/+&|1|2|3> @56 diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -2141,6 +2141,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/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4334, +/**/ 4333, /**/ 4332,