Mercurial > vim
changeset 27615:a74901e95937 v8.2.4334
patch 8.2.4334: command line popup menu not positioned correctly
Commit: https://github.com/vim/vim/commit/68cc2b8a37197872e737fb61244069e13b7227a2
Author: rbtnn <naru123456789@gmail.com>
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 09 Feb 2022 13:00:05 +0100 |
parents | 0d11933dc9e9 |
children | 431c6a7a1f8b |
files | src/cmdexpand.c src/testdir/dumps/Test_wildmenu_pum_32.dump src/testdir/test_cmdline.vim src/version.c |
diffstat | 4 files changed, 24 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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) {
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
--- 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, "\<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')