// NOTE: must call restore_last_search_pattern() before returning!
save_last_search_pattern();
- if (!do_incsearch_highlighting(firstc, &search_delim, is_state, &skiplen, &patlen))
+ if (!do_incsearch_highlighting(firstc, &search_delim, is_state,
+ &skiplen, &patlen))
{
restore_last_search_pattern();
finish_incsearch_highlighting(FALSE, is_state, TRUE);
if (has_mbyte)
j -= (*mb_head_off)(ccline.cmdbuff, ccline.cmdbuff + j);
if (vim_ispathsep(ccline.cmdbuff[j])
-#ifdef BACKSLASH_IN_FILENAME
+# ifdef BACKSLASH_IN_FILENAME
&& vim_strchr((char_u *)" *?[{`$%#",
ccline.cmdbuff[j + 1]) == NULL
-#endif
+# endif
)
{
if (found)
if ((c == p_wc && !gotesc && KeyTyped) || c == p_wcm)
{
int options = WILD_NO_BEEP;
+
if (wim_flags[wim_index] & WIM_BUFLASTUSED)
options |= WILD_BUFLASTUSED;
if (xpc.xp_numfiles > 0) // typed p_wc at least twice
res = nextwild(&xpc, WILD_LONGEST, options,
firstc != '@');
else if (wim_flags[wim_index] & WIM_FULL)
- res = nextwild(&xpc, WILD_NEXT, options,
- firstc != '@');
+ res = nextwild(&xpc, WILD_NEXT, options, firstc != '@');
else
res = OK; // don't insert 'wildchar' now
}
// if 'wildmode' first contains "longest", get longest
// common part
if (wim_flags[0] & WIM_LONGEST)
- res = nextwild(&xpc, WILD_LONGEST, options,
- firstc != '@');
+ res = nextwild(&xpc, WILD_LONGEST, options, firstc != '@');
else
res = nextwild(&xpc, WILD_EXPAND_KEEP, options,
- firstc != '@');
+ firstc != '@');
// if interrupted while completing, behave like it failed
if (got_int)
wim_index = 1;
if ((wim_flags[wim_index] & WIM_LIST)
#ifdef FEAT_WILDMENU
- || (p_wmnu && (wim_flags[wim_index] & WIM_FULL) != 0)
+ || (p_wmnu && (wim_flags[wim_index] & WIM_FULL) != 0)
#endif
)
{
nextwild(&xpc, WILD_LONGEST, options,
firstc != '@');
else if (wim_flags[wim_index] & WIM_FULL)
- nextwild(&xpc, WILD_NEXT, options,
- firstc != '@');
+ nextwild(&xpc, WILD_NEXT, options, firstc != '@');
}
else
vim_beep(BO_WILD);
trigger_cmd_autocmd(cmdline_type, EVENT_CMDLINECHANGED);
#ifdef FEAT_SEARCH_EXTRA
- may_do_incsearch_highlighting(firstc, count, &is_state);
+ if (xpc.xp_context == EXPAND_NOTHING)
+ may_do_incsearch_highlighting(firstc, count, &is_state);
#endif
#ifdef FEAT_RIGHTLEFT
call delete('Xdir1', 'd')
set nowildmenu
endfunc
+f
+func Test_wildmenu_screendump()
+ CheckScreendump
+
+ let lines =<< trim [SCRIPT]
+ set wildmenu hlsearch
+ [SCRIPT]
+ call writefile(lines, 'XTest_wildmenu')
+
+ let buf = RunVimInTerminal('-S XTest_wildmenu', {'rows': 8})
+ call term_sendkeys(buf, ":vim\<Tab>")
+ call VerifyScreenDump(buf, 'Test_wildmenu_1', {})
+
+ call term_sendkeys(buf, "\<Tab>")
+ call VerifyScreenDump(buf, 'Test_wildmenu_2', {})
+
+ call term_sendkeys(buf, "\<Tab>")
+ call VerifyScreenDump(buf, 'Test_wildmenu_3', {})
+
+ call term_sendkeys(buf, "\<Tab>")
+ call VerifyScreenDump(buf, 'Test_wildmenu_4', {})
+ call term_sendkeys(buf, "\<Esc>")
+
+ " clean up
+ call StopVimInTerminal(buf)
+ call delete('XTest_wildmenu')
+endfunc
+
func Test_map_completion()
CheckFeature cmdline_compl