]> granicus.if.org Git - vim/commitdiff
patch 8.2.4334: command line popup menu not positioned correctly v8.2.4334
authorrbtnn <naru123456789@gmail.com>
Wed, 9 Feb 2022 11:55:47 +0000 (11:55 +0000)
committerBram Moolenaar <Bram@vim.org>
Wed, 9 Feb 2022 11:55:47 +0000 (11:55 +0000)
Problem:    Command line popup menu not positioned correctly.
Solution:   Also use vim_strsize() on the existing text. (Naruhiko Nishino,
            closes #9727)

src/cmdexpand.c
src/testdir/dumps/Test_wildmenu_pum_32.dump [new file with mode: 0644]
src/testdir/test_cmdline.vim
src/version.c

index b37c4f9acb0c47707df62eab1acfb988c2e7930b..2463ed53e33410ac4903ef528a0baa0277e90b4c 100644 (file)
@@ -622,7 +622,7 @@ showmatches(expand_T *xp, int wildmenu UNUSED)
            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 (file)
index 0000000..a8a0dfe
--- /dev/null
@@ -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
index 175647dd175fbdab37bc147322309bfe7b03b769..c40d653d3c294dd4c280de83748384bed8aaaacf 100644 (file)
@@ -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, "\<C-U>set wildmode&\<CR>")
+  call term_sendkeys(buf, ":\<C-U>e Xdir/あいう/\<Tab>")
+  call TermWait(buf)
+  call VerifyScreenDump(buf, 'Test_wildmenu_pum_32', {})
+
   call term_sendkeys(buf, "\<C-U>\<CR>")
   call StopVimInTerminal(buf)
   call delete('Xtest')
index a4480e1866dc062387ca8bbf4eefe44966cd3553..9ef520ebcbe14bdedb49ea8a383d92634b23a285 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4334,
 /**/
     4333,
 /**/