diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ex_getln.c | 4 | ||||
-rw-r--r-- | src/nvim/testdir/test_cmdline.vim | 13 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 5e3cdd5da2..5868e3660f 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -1082,6 +1082,7 @@ static int command_line_execute(VimState *state, int key) if (s->c == K_DOWN && ccline.cmdpos > 0 && ccline.cmdbuff[ccline.cmdpos - 1] == '.') { s->c = (int)p_wc; + KeyTyped = true; // in case the key was mapped } else if (s->c == K_UP) { // Hitting <Up>: Remove one submenu name in front of the // cursor @@ -1112,6 +1113,7 @@ static int command_line_execute(VimState *state, int key) cmdline_del(i); } s->c = (int)p_wc; + KeyTyped = true; // in case the key was mapped s->xpc.xp_context = EXPAND_NOTHING; } } @@ -1134,6 +1136,7 @@ static int command_line_execute(VimState *state, int key) || ccline.cmdbuff[ccline.cmdpos - 3] != '.')) { // go down a directory s->c = (int)p_wc; + KeyTyped = true; // in case the key was mapped } else if (STRNCMP(s->xpc.xp_pattern, upseg + 1, 3) == 0 && s->c == K_DOWN) { // If in a direct ancestor, strip off one ../ to go down @@ -1154,6 +1157,7 @@ static int command_line_execute(VimState *state, int key) && (vim_ispathsep(ccline.cmdbuff[j - 3]) || j == i + 2)) { cmdline_del(j - 2); s->c = (int)p_wc; + KeyTyped = true; // in case the key was mapped } } else if (s->c == K_UP) { // go up a directory diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index 8fc3361b79..0c31619086 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -51,6 +51,19 @@ func Test_complete_wildmenu() call feedkeys(":e Xdir1/\<Tab>\<Down>\<Up>\<Right>\<CR>", 'tx') call assert_equal('testfile1', getline(1)) + + " <C-J>/<C-K> mappings to go up/down directories when 'wildcharm' is + " different than 'wildchar'. + set wildcharm=<C-Z> + cnoremap <C-J> <Down><C-Z> + cnoremap <C-K> <Up><C-Z> + call feedkeys(":e Xdir1/\<Tab>\<C-J>\<CR>", 'tx') + call assert_equal('testfile3', getline(1)) + call feedkeys(":e Xdir1/\<Tab>\<C-J>\<C-K>\<CR>", 'tx') + call assert_equal('testfile1', getline(1)) + set wildcharm=0 + cunmap <C-J> + cunmap <C-K> + " cleanup %bwipe call delete('Xdir1/Xdir2/Xtestfile4') |