# HG changeset patch # User Bram Moolenaar # Date 1608981304 -3600 # Node ID 32a9d01c2a497cd3208955b426b3101b2712d368 # Parent b63398c0d29e4fddcd7a8d9ca104d65c1b8e2699 patch 8.2.2221: if is mapped on the command line 'wildchar' is inserted Commit: https://github.com/vim/vim/commit/b0ac4ea5e1c5f0ff4e951978c32ccfffe46916f8 Author: Bram Moolenaar Date: Sat Dec 26 12:06:54 2020 +0100 patch 8.2.2221: if is mapped on the command line 'wildchar' is inserted Problem: If is mapped on the command line 'wildchar' is inserted. Solution: Set KeyTyped when using 'wildchar'. (closes https://github.com/vim/vim/issues/7552) diff --git a/src/cmdexpand.c b/src/cmdexpand.c --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -2680,7 +2680,10 @@ wildmenu_process_key(cmdline_info_T *ccl // Hitting after "emenu Name.": complete submenu if (c == K_DOWN && cclp->cmdpos > 0 && cclp->cmdbuff[cclp->cmdpos - 1] == '.') + { c = p_wc; + KeyTyped = TRUE; // in case the key was mapped + } else if (c == K_UP) { // Hitting : Remove one submenu name in front of the @@ -2714,6 +2717,7 @@ wildmenu_process_key(cmdline_info_T *ccl if (i > 0) cmdline_del(cclp, i); c = p_wc; + KeyTyped = TRUE; // in case the key was mapped xp->xp_context = EXPAND_NOTHING; } } @@ -2738,6 +2742,7 @@ wildmenu_process_key(cmdline_info_T *ccl { // go down a directory c = p_wc; + KeyTyped = TRUE; // in case the key was mapped } else if (STRNCMP(xp->xp_pattern, upseg + 1, 3) == 0 && c == K_DOWN) { @@ -2763,6 +2768,7 @@ wildmenu_process_key(cmdline_info_T *ccl { cmdline_del(cclp, j - 2); c = p_wc; + KeyTyped = TRUE; // in case the key was mapped } } else if (c == K_UP) 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 @@ -58,6 +58,19 @@ func Test_complete_wildmenu() call feedkeys(":e Xdir1/\\\\\", 'tx') call assert_equal('testfile1', getline(1)) + + " / mappings to go up/down directories when 'wildcharm' is + " different than 'wildchar'. + set wildcharm= + cnoremap + cnoremap + call feedkeys(":e Xdir1/\\\", 'tx') + call assert_equal('testfile3', getline(1)) + call feedkeys(":e Xdir1/\\\\", 'tx') + call assert_equal('testfile1', getline(1)) + set wildcharm=0 + cunmap + cunmap + " Test for canceling the wild menu by adding a character redrawstatus call feedkeys(":e Xdir1/\x\\"\", 'xt') diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2221, +/**/ 2220, /**/ 2219,