0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 9.0.1550: in cmdline window S-Tab does not select previous completion

Problem:    In cmdline window S-Tab does not select previous completion.
            (Maxim Kim)
Solution:   Add a mappint for S-Tab. (closes #12116)
This commit is contained in:
Bram Moolenaar 2023-05-13 13:55:09 +01:00
parent b848ce6b7e
commit 81f277f526
3 changed files with 22 additions and 0 deletions

View File

@ -4486,8 +4486,12 @@ open_cmdwin(void)
{
if (p_wc == TAB)
{
// Make Tab start command-line completion: CTRL-X CTRL-V
add_map((char_u *)"<buffer> <Tab> <C-X><C-V>", MODE_INSERT, TRUE);
add_map((char_u *)"<buffer> <Tab> a<C-X><C-V>", MODE_NORMAL, TRUE);
// Make S-Tab work like CTRL-P in command-line completion
add_map((char_u *)"<buffer> <S-Tab> <C-P>", MODE_INSERT, TRUE);
}
set_option_value_give_err((char_u *)"ft",
0L, (char_u *)"vim", OPT_LOCAL);

View File

@ -359,6 +359,22 @@ func Test_compl_in_cmdwin()
set wildmenu& wildchar&
endfunc
func Test_cmdwin_cmd_completion()
set wildmenu wildchar=<Tab>
com! -nargs=* -complete=command SomeOne echo 'one'
com! -nargs=* -complete=command SomeTwo echo 'two'
call feedkeys("q:aSome\<Tab>\<Home>\"\<CR>", 'tx')
call assert_equal('"SomeOne', @:)
call feedkeys("q:aSome\<Tab>\<Tab>\<Home>\"\<CR>", 'tx')
call assert_equal('"SomeTwo', @:)
call feedkeys("q:aSome\<Tab>\<Tab>\<S-Tab>\<Home>\"\<CR>", 'tx')
call assert_equal('"SomeOne', @:)
delcom SomeOne
delcom SomeTwo
set wildmenu& wildchar&
endfunc
func Test_cmdwin_ctrl_bsl()
" Using CTRL-\ CTRL-N in cmd window should close the window
call feedkeys("q:\<C-\>\<C-N>", 'xt')

View File

@ -695,6 +695,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1550,
/**/
1549,
/**/