Problem: The tiny version has the popup menu but not 'wildmenu'.
Solution: Graduate the wildmenu feature.
*'wildmenu'* *'wmnu'* *'nowildmenu'* *'nowmnu'*
'wildmenu' 'wmnu' boolean (default off, set in |defaults.vim|)
global
- {not available if compiled without the |+wildmenu|
- feature}
When 'wildmenu' is on, command-line completion operates in an enhanced
mode. On pressing 'wildchar' (usually <Tab>) to invoke completion,
- the possible matches are shown just above the command line, with the
- first match highlighted (overwriting the status line, if there is
- one). This is the behavior without "pum" in 'wildoptions'.
+ the possible matches are shown.
+ When 'wildoptions' contains "pum", then the completion matches are
+ shown in a popup menu. Otherwise they are displayed just above the
+ command line, with the first match highlighted (overwriting the status
+ line, if there is one).
Keys that show the previous/next match, such as <Tab> or
CTRL-P/CTRL-N, cause the highlight to move to the appropriate match.
When 'wildmode' is used, "wildmenu" mode is used where "full" is
If there are more matches than can fit in the line, a ">" is shown on
the right and/or a "<" is shown on the left. The status line scrolls
as needed.
- When 'wildoptions' contains "pum", then the completion matches are
- shown in a popup menu.
The "wildmenu" mode is abandoned when a key is hit that is not used
for selecting a completion.
While the "wildmenu" is active, not using the popup menu, the
T *+vreplace* |gR| and |gr|
*+vtp* on MS-Windows console: support for 'termguicolors'
T *+wildignore* |'wildignore'| Always enabled since 9.0.0278
-N *+wildmenu* |'wildmenu'|
+T *+wildmenu* |'wildmenu'|| Always enabled since 9.0.0279
T *+windows* more than one window; Always enabled since 8.0.1118.
m *+writebackup* |'writebackup'| is default on
m *+xim* X input method |xim|
static int ExpandUserList(expand_T *xp, char_u ***matches, int *numMatches);
#endif
-#ifdef FEAT_WILDMENU
// "compl_match_array" points the currently displayed list of entries in the
// popup menu. It is NULL when there is no popup menu.
static pumitem_T *compl_match_array = NULL;
// First column in cmdline of the matched item for completion.
static int compl_startcol;
static int compl_selected;
-#endif
#define SHOW_FILE_TEXT(m) (showtail ? sm_gettail(matches[m]) : matches[m])
return OK;
}
-#if defined(FEAT_WILDMENU) || defined(PROTO)
-
/*
* Create and display a cmdline completion popup menu with items from
* 'matches'.
{
return compl_startcol;
}
-#endif
/*
* Get the next or prev cmdline completion match. The index of the match is set
else
findex = -1;
}
-#ifdef FEAT_WILDMENU
if (compl_match_array)
{
compl_selected = findex;
else if (p_wmnu)
win_redr_status_matches(xp, xp->xp_numfiles, xp->xp_files,
findex, cmd_showtail);
-#endif
*p_findex = findex;
if (findex == -1)
showtail = cmd_showtail;
}
-#ifdef FEAT_WILDMENU
if (wildmenu && vim_strchr(p_wop, WOP_PUM) != NULL)
// cmdline completion popup menu (with wildoptions=pum)
return cmdline_pum_create(ccline, xp, matches, numMatches, showtail);
-#endif
-#ifdef FEAT_WILDMENU
if (!wildmenu)
{
-#endif
msg_didany = FALSE; // lines_left will be set
msg_start(); // prepare for paging
msg_putchar('\n');
cmdline_row = msg_row;
msg_didany = FALSE; // lines_left will be set again
msg_start(); // prepare for paging
-#ifdef FEAT_WILDMENU
}
-#endif
if (got_int)
got_int = FALSE; // only int. the completion, not the cmd line
-#ifdef FEAT_WILDMENU
else if (wildmenu)
win_redr_status_matches(xp, numMatches, matches, -1, showtail);
-#endif
else
{
// find the length of the longest file name
vim_free(buf);
}
-#ifdef FEAT_WILDMENU
-
/*
* Translate some keys pressed when 'wildmenu' is used.
*/
{
int c = key;
-#ifdef FEAT_WILDMENU
if (cmdline_pum_active())
{
// When the popup menu is used for cmdline completion:
default: break;
}
}
-#endif
if (did_wild_list)
{
if (cclp->input_fn)
RedrawingDisabled = old_RedrawingDisabled;
}
-#endif
#if defined(FEAT_EVAL) || defined(PROTO)
/*
}
else if (State & MODE_CMDLINE)
{
-#ifdef FEAT_WILDMENU
if (pum_visible())
cmdline_pum_display();
-#endif
+
// Don't redraw when in prompt_for_number().
if (cmdline_row > 0)
{
// Redrawing only works when the screen didn't scroll. Don't clear
// wildmenu entries.
if (msg_scrolled == 0
-#ifdef FEAT_WILDMENU
&& wild_menu_showing == 0
-#endif
&& call_update_screen)
update_screen(0);
{
win_T *wp;
-#ifdef FEAT_WILDMENU
if (wild_menu_showing != 0)
// Don't redraw while the command line completion is displayed, it
// would disappear.
return;
-#endif
FOR_ALL_WINDOWS(wp)
{
if (wp->w_buffer == buf)
draw_tabline();
}
-#if defined(FEAT_WILDMENU) || defined(PROTO)
/*
* Redraw all status lines at the bottom of frame "frp".
*/
win_redraw_last_status(frp);
}
}
-#endif
/*
* Changed something in the current window, at buffer line "lnum", that
#endif
},
{"wildignore", 1},
- {"wildmenu",
-#ifdef FEAT_WILDMENU
- 1
-#else
- 0
-#endif
- },
+ {"wildmenu", 1},
{"windows", 1},
{"winaltkeys",
#ifdef FEAT_WAK
static void
f_wildmenumode(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
-#ifdef FEAT_WILDMENU
if (wild_menu_showing || ((State & MODE_CMDLINE) && cmdline_pum_active()))
rettv->vval.v_number = 1;
-#endif
}
/*
if (xp->xp_numfiles > 1
&& !*did_wild_list
&& ((wim_flags[wim_index] & WIM_LIST)
-#ifdef FEAT_WILDMENU
- || (p_wmnu && (wim_flags[wim_index] & WIM_FULL) != 0)
-#endif
- ))
+ || (p_wmnu && (wim_flags[wim_index] & WIM_FULL) != 0)))
{
-#ifdef FEAT_WILDMENU
(void)showmatches(xp,
p_wmnu && ((wim_flags[wim_index] & WIM_LIST) == 0));
-#else
- (void)showmatches(xp, FALSE);
-#endif
redrawcmd();
*did_wild_list = TRUE;
}
(void)vpeekc(); // remove <C-C> from input stream
got_int = FALSE; // don't abandon the command line
(void)ExpandOne(xp, NULL, NULL, 0, WILD_FREE);
-#ifdef FEAT_WILDMENU
xp->xp_context = EXPAND_NOTHING;
-#endif
*wim_index_p = wim_index;
return CMDLINE_CHANGED;
}
if (wim_flags[0] == WIM_LONGEST && ccline.cmdpos == j)
wim_index = 1;
if ((wim_flags[wim_index] & WIM_LIST)
-#ifdef FEAT_WILDMENU
- || (p_wmnu && (wim_flags[wim_index] & WIM_FULL) != 0)
-#endif
- )
+ || (p_wmnu && (wim_flags[wim_index] & WIM_FULL) != 0))
{
if (!(wim_flags[0] & WIM_LONGEST))
{
-#ifdef FEAT_WILDMENU
int p_wmnu_save = p_wmnu;
+
p_wmnu = 0;
-#endif
+
// remove match
nextwild(xp, WILD_PREV, 0, escape);
-#ifdef FEAT_WILDMENU
p_wmnu = p_wmnu_save;
-#endif
}
-#ifdef FEAT_WILDMENU
(void)showmatches(xp, p_wmnu
&& ((wim_flags[wim_index] & WIM_LIST) == 0));
-#else
- (void)showmatches(xp, FALSE);
-#endif
redrawcmd();
*did_wild_list = TRUE;
if (wim_flags[wim_index] & WIM_LONGEST)
else
vim_beep(BO_WILD);
}
-#ifdef FEAT_WILDMENU
else if (xp->xp_numfiles == -1)
xp->xp_context = EXPAND_NOTHING;
-#endif
}
if (wim_index < 3)
++wim_index;
if (c != p_wc && c == K_S_TAB && xpc.xp_numfiles > 0)
c = Ctrl_P;
-#ifdef FEAT_WILDMENU
if (p_wmnu)
c = wildmenu_translate_key(&ccline, c, &xpc, did_wild_list);
c = Ctrl_E;
}
}
-#endif
// The wildmenu is cleared if the pressed key is not used for
// navigating the wild menu (i.e. the key is not 'wildchar' or
// also used to navigate the menu.
end_wildmenu = (!(c == p_wc && KeyTyped) && c != p_wcm
&& c != Ctrl_N && c != Ctrl_P && c != Ctrl_A && c != Ctrl_L);
-#ifdef FEAT_WILDMENU
end_wildmenu = end_wildmenu && (!cmdline_pum_active() ||
(c != K_PAGEDOWN && c != K_PAGEUP
&& c != K_KPAGEDOWN && c != K_KPAGEUP));
-#endif
// free expanded names when finished walking through matches
if (end_wildmenu)
{
-#ifdef FEAT_WILDMENU
if (cmdline_pum_active())
cmdline_pum_remove();
-#endif
if (xpc.xp_numfiles != -1)
(void)ExpandOne(&xpc, NULL, NULL, 0, WILD_FREE);
did_wild_list = FALSE;
-#ifdef FEAT_WILDMENU
if (!p_wmnu || (c != K_UP && c != K_DOWN))
-#endif
xpc.xp_context = EXPAND_NOTHING;
wim_index = 0;
-#ifdef FEAT_WILDMENU
wildmenu_cleanup(&ccline);
-#endif
}
-#ifdef FEAT_WILDMENU
if (p_wmnu)
c = wildmenu_process_key(&ccline, c, &xpc);
-#endif
// CTRL-\ CTRL-N goes to Normal mode, CTRL-\ CTRL-G goes to Insert
// mode when 'insertmode' is set, CTRL-\ e prompts for an expression.
{
if (xpc.xp_numfiles > 1
&& ((!did_wild_list && (wim_flags[wim_index] & WIM_LIST))
-#ifdef FEAT_WILDMENU
- || p_wmnu
-#endif
- ))
+ || p_wmnu))
{
-#ifdef FEAT_WILDMENU
// Trigger the popup menu when wildoptions=pum
showmatches(&xpc, p_wmnu
&& ((wim_flags[wim_index] & WIM_LIST) == 0));
-#else
- (void)showmatches(&xpc, FALSE);
-#endif
}
if (nextwild(&xpc, WILD_PREV, 0, firstc != '@') == OK
&& nextwild(&xpc, WILD_PREV, 0, firstc != '@') == OK)
goto cmdline_not_changed;
case Ctrl_A: // all matches
-#ifdef FEAT_WILDMENU
if (cmdline_pum_active())
// As Ctrl-A completes all the matches, close the popup
// menu (if present)
cmdline_pum_cleanup(&ccline);
-#endif
+
if (nextwild(&xpc, WILD_ALL, 0, firstc != '@') == FAIL)
break;
xpc.xp_context = EXPAND_NOTHING;
case K_KPAGEUP:
case K_PAGEDOWN:
case K_KPAGEDOWN:
-#ifdef FEAT_WILDMENU
if (cmdline_pum_active()
&& (c == K_PAGEUP || c == K_PAGEDOWN ||
c == K_KPAGEUP || c == K_KPAGEDOWN))
goto cmdline_not_changed;
}
else
-#endif
{
res = cmdline_browse_history(c, firstc, &lookfor, histype,
&hiscnt, &xpc);
* +file_in_path "gf" and "<cfile>" commands.
* +path_extra up/downwards searching in 'path' and 'tags'.
* +wildignore 'wildignore' and 'backupskip' options
+ * +wildmenu 'wildmenu' option
*
* Obsolete:
* +tag_old_static Old style static tags: "file:tag file ..".
# define FEAT_BYTEOFF
#endif
-/*
- * +wildmenu 'wildmenu' option
- */
-#if defined(FEAT_NORMAL)
-# define FEAT_WILDMENU
-#endif
-
/*
* +viminfo reading/writing the viminfo file. Takes about 8Kbyte
* of code.
EXTERN char_u langmap_mapchar[256]; // mapping for language keys
#endif
-#ifdef FEAT_WILDMENU
EXTERN int save_p_ls INIT(= -1); // Save 'laststatus' setting
EXTERN int save_p_wmh INIT(= -1); // Save 'winminheight' setting
EXTERN int wild_menu_showing INIT(= 0);
-# define WM_SHOWN 1 // wildmenu showing
-# define WM_SCROLLED 2 // wildmenu showing with scroll
-#endif
+#define WM_SHOWN 1 // wildmenu showing
+#define WM_SCROLLED 2 // wildmenu showing with scroll
#ifdef MSWIN
EXTERN char_u toupper_tab[256]; // table for toupper()
"Title term=bold ctermfg=DarkMagenta gui=bold guifg=Magenta"),
CENT("WarningMsg term=standout ctermfg=DarkRed",
"WarningMsg term=standout ctermfg=DarkRed guifg=Red"),
-#ifdef FEAT_WILDMENU
CENT("WildMenu term=standout ctermbg=Yellow ctermfg=Black",
"WildMenu term=standout ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black"),
-#endif
#ifdef FEAT_FOLDING
CENT("Folded term=standout ctermbg=Grey ctermfg=DarkBlue",
"Folded term=standout ctermbg=Grey ctermfg=DarkBlue guibg=LightGrey guifg=DarkBlue"),
"Title term=bold ctermfg=LightMagenta gui=bold guifg=Magenta"),
CENT("WarningMsg term=standout ctermfg=LightRed",
"WarningMsg term=standout ctermfg=LightRed guifg=Red"),
-#ifdef FEAT_WILDMENU
CENT("WildMenu term=standout ctermbg=Yellow ctermfg=Black",
"WildMenu term=standout ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black"),
-#endif
#ifdef FEAT_FOLDING
CENT("Folded term=standout ctermbg=DarkGrey ctermfg=Cyan",
"Folded term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=DarkGrey guifg=Cyan"),
EXTERN long p_wcm; // 'wildcharm'
EXTERN int p_wic; // 'wildignorecase'
EXTERN char_u *p_wim; // 'wildmode'
-#ifdef FEAT_WILDMENU
EXTERN int p_wmnu; // 'wildmenu'
-#endif
EXTERN long p_wh; // 'winheight'
EXTERN long p_wmh; // 'winminheight'
EXTERN long p_wmw; // 'winminwidth'
(char_u *)&p_wic, PV_NONE,
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{"wildmenu", "wmnu", P_BOOL|P_VI_DEF,
-#ifdef FEAT_WILDMENU
(char_u *)&p_wmnu, PV_NONE,
-#else
- (char_u *)NULL, PV_NONE,
-#endif
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{"wildmode", "wim", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP,
(char_u *)&p_wim, PV_NONE,
max_width = pum_base_width;
// Calculate column
-#ifdef FEAT_WILDMENU
if (State == MODE_CMDLINE)
// cmdline completion popup menu
cursor_col = cmdline_compl_startcol();
else
-#endif
#ifdef FEAT_RIGHTLEFT
if (right_left)
cursor_col = curwin->w_wincol + curwin->w_width
}
}
-#ifdef FEAT_WILDMENU
static int skip_status_match_char(expand_T *xp, char_u *s);
/*
win_redraw_last_status(topframe);
vim_free(buf);
}
-#endif
/*
* Return TRUE if the status line of window "wp" is connected to the status
# endif
#endif
"+wildignore",
-#ifdef FEAT_WILDMENU
"+wildmenu",
-#else
- "-wildmenu",
-#endif
"+windows",
#ifdef FEAT_WRITEBACKUP
"+writebackup",
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 279,
/**/
278,
/**/