{
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
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()