]> granicus.if.org Git - vim/commitdiff
patch 9.0.0238: Shift-Tab shows matches on cmdline when 'wildmenu' is off v9.0.0238
authorBram Moolenaar <Bram@vim.org>
Sun, 21 Aug 2022 17:38:21 +0000 (18:38 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 21 Aug 2022 17:38:21 +0000 (18:38 +0100)
Problem:    Shift-Tab shows matches on cmdline when 'wildmenu' is off.
Solution:   Only show matches when 'wildmode' contains "list". (closes #10951)

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

index 04273379b3dc97d692611ed22d5bef5d81387576..6b62d84cf17a00f676500b378646f1f1d7ee9795 100644 (file)
@@ -2033,7 +2033,12 @@ getcmdline_int(
        {
            if (nextwild(&xpc, WILD_EXPAND_KEEP, 0, firstc != '@') == OK)
            {
-               if (xpc.xp_numfiles > 1)
+               if (xpc.xp_numfiles > 1
+                   && ((!did_wild_list && (wim_flags[wim_index] & WIM_LIST))
+#ifdef FEAT_WILDMENU
+                           || p_wmnu)
+#endif
+                       )
                {
 #ifdef FEAT_WILDMENU
                    // Trigger the popup menu when wildoptions=pum
index be688e39696d426db61aa5cba6be669f80bc332b..3372e8dd31c22ed6b78bf3c0330395b25483aa9c 100644 (file)
@@ -874,6 +874,24 @@ func Test_cmdline_complete_user_cmd()
   call feedkeys(":Foo b\\x\<Tab>\<Home>\"\<cr>", 'tx')
   call assert_equal('"Foo b\x', @:)
   delcommand Foo
+
+  redraw
+  call assert_equal('~', Screenline(&lines - 1))
+  command! FooOne :
+  command! FooTwo :
+
+  set nowildmenu
+  call feedkeys(":Foo\<Tab>\<Home>\"\<cr>", 'tx')
+  call assert_equal('"FooOne', @:)
+  call assert_equal('~', Screenline(&lines - 1))
+
+  call feedkeys(":Foo\<S-Tab>\<Home>\"\<cr>", 'tx')
+  call assert_equal('"FooTwo', @:)
+  call assert_equal('~', Screenline(&lines - 1))
+
+  delcommand FooOne
+  delcommand FooTwo
+  set wildmenu&
 endfunc
 
 func Test_complete_user_cmd()
index 3788596440f7f9d538009fc35671ca1cb1c13ac9..289d0e68545537e8151cfa281d6a9e657910bf6a 100644 (file)
@@ -731,6 +731,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    238,
 /**/
     237,
 /**/