Skip to content

Commit

Permalink
patch 9.0.1290: CTRL-N and -P on cmdline don't trigger CmdlineChanged
Browse files Browse the repository at this point in the history
Problem:    CTRL-N and -P on cmdline don't trigger CmdlineChanged.
Solution:   Jump to cmdline_changed instead of cmdline_not_changed.
            (closes #11956)
  • Loading branch information
zeertzjq authored and brammool committed Feb 6, 2023
1 parent 43e234e commit af9e28a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ex_getln.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
{
Expand Down
35 changes: 35 additions & 0 deletions src/testdir/test_autocmd.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1290,
/**/
1289,
/**/
Expand Down

0 comments on commit af9e28a

Please sign in to comment.