]> granicus.if.org Git - vim/commitdiff
patch 9.0.1290: CTRL-N and -P on cmdline don't trigger CmdlineChanged v9.0.1290
authorzeertzjq <zeertzjq@outlook.com>
Mon, 6 Feb 2023 20:58:09 +0000 (20:58 +0000)
committerBram Moolenaar <Bram@vim.org>
Mon, 6 Feb 2023 20:58:09 +0000 (20:58 +0000)
Problem:    CTRL-N and -P on cmdline don't trigger CmdlineChanged.
Solution:   Jump to cmdline_changed instead of cmdline_not_changed.
            (closes #11956)

src/ex_getln.c
src/testdir/test_autocmd.vim
src/version.c

index 2407bceb162ea8f7fd010167864b648746b05f9b..6d0b3c5db62724a6d9a82fc6d95cc232a5006524 100644 (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
                {
index 8931678d74ed30728af3128b96d7bb1e4457cc50..c11f6ff306e4d3d25345777cf4fc9879d7b2aa2d 100644 (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
index d7b12b1f1afd31cf4b0accfacfe974397ceec1ff..3523df2b91abbfae7b2f582435e67f748b5d15ef 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1290,
 /**/
     1289,
 /**/