int key_is_wc = (c == p_wc && KeyTyped) || c == p_wcm;
if ((cmdline_pum_active() || wild_menu_showing || did_wild_list)
- && !key_is_wc)
+ && !key_is_wc && xpc.xp_numfiles > 0)
{
// Ctrl-Y: Accept the current selection and close the popup menu.
// Ctrl-E: cancel the cmdline popup menu and return the original
call feedkeys(":sign un zz\<Left>\<Left>\<Left>\<Tab>\<Tab>\<C-Y> yy\<C-B>\"\<CR>", 'tx')
call assert_equal('"sign unplace yy zz', @:)
+ " This used to crash
+ call feedkeys(":sign un\<Tab>\<S-Tab>\<C-A>\<C-Y>\<C-B>\"\<CR>", 'tx')
+ " Ctrl-Y is inserted literally like before 9.1.1714
+ call assert_equal("\"sign undefine unplace\<C-Y>", @:)
+ " Also test Ctrl-Y after Ctrl-A with selected item (the result is the same)
+ call feedkeys(":sign un\<Tab>\<C-A>\<C-Y>\<C-B>\"\<CR>", 'tx')
+ call assert_equal("\"sign undefine unplace\<C-Y>", @:)
+ call feedkeys(":sign un\<Tab>\<Tab>\<C-A>\<C-Y>\<C-B>\"\<CR>", 'tx')
+ call assert_equal("\"sign undefine unplace\<C-Y>", @:)
+
" cleanup
%bwipe
set nowildmenu