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

patch 9.0.1290: CTRL-N and -P on cmdline don't trigger CmdlineChanged

Problem:    CTRL-N and -P on cmdline don't trigger CmdlineChanged.
Solution:   Jump to cmdline_changed instead of cmdline_not_changed.
            (closes #11956)
This commit is contained in:
zeertzjq 2023-02-06 20:58:09 +00:00 committed by Bram Moolenaar
parent 43e234e8b4
commit af9e28a5b8
3 changed files with 39 additions and 2 deletions

View File

@ -2293,7 +2293,7 @@ getcmdline_int(
wild_type = (c == Ctrl_P) ? WILD_PREV : WILD_NEXT;
if (nextwild(&xpc, wild_type, 0, firstc != '@') == FAIL)
break;
goto cmdline_not_changed;
goto cmdline_changed;
}
// FALLTHROUGH
case K_UP:
@ -2315,7 +2315,7 @@ getcmdline_int(
wild_type = WILD_PAGEDOWN;
if (nextwild(&xpc, wild_type, 0, firstc != '@') == FAIL)
break;
goto cmdline_not_changed;
goto cmdline_changed;
}
else
{

View File

@ -1918,6 +1918,41 @@ func Test_Cmdline()
au! CmdlineChanged
cunmap <F1>
let g:log = []
autocmd CmdlineChanged : let g:log += [getcmdline()]
call feedkeys(":sign \<Tab>\<Tab>\<C-N>\<C-P>\<S-Tab>\<S-Tab>\<Esc>", 'xt')
call assert_equal([
\ 's',
\ 'si',
\ 'sig',
\ 'sign',
\ 'sign ',
\ 'sign define',
\ 'sign jump',
\ 'sign list',
\ 'sign jump',
\ 'sign define',
\ 'sign ',
\ ], g:log)
let g:log = []
set wildmenu wildoptions+=pum
call feedkeys(":sign \<S-Tab>\<PageUp>\<kPageUp>\<kPageDown>\<PageDown>\<Esc>", 'xt')
call assert_equal([
\ 's',
\ 'si',
\ 'sig',
\ 'sign',
\ 'sign ',
\ 'sign unplace',
\ 'sign jump',
\ 'sign define',
\ 'sign undefine',
\ 'sign unplace',
\ ], g:log)
set wildmenu& wildoptions&
unlet g:log
au! CmdlineChanged
au! CmdlineEnter : let g:entered = expand('<afile>')
au! CmdlineLeave : let g:left = expand('<afile>')
let g:entered = 0

View File

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