mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 9.0.1227: no cmdline completion for :runtime
Problem: No cmdline completion for :runtime. Solution: Add completion for :runtime. (closes #11853, closes #11447) Improve the resulting matches.
This commit is contained in:
@@ -56,6 +56,7 @@ cmdline_fuzzy_completion_supported(expand_T *xp)
|
||||
&& xp->xp_context != EXPAND_OLD_SETTING
|
||||
&& xp->xp_context != EXPAND_OWNSYNTAX
|
||||
&& xp->xp_context != EXPAND_PACKADD
|
||||
&& xp->xp_context != EXPAND_RUNTIME
|
||||
&& xp->xp_context != EXPAND_SHELLCMD
|
||||
&& xp->xp_context != EXPAND_TAGS
|
||||
&& xp->xp_context != EXPAND_TAGS_LISTFILES
|
||||
@@ -1362,6 +1363,7 @@ addstar(
|
||||
// For a tag pattern starting with "/" no translation is needed.
|
||||
if (context == EXPAND_HELP
|
||||
|| context == EXPAND_COLORS
|
||||
|| context == EXPAND_RUNTIME
|
||||
|| context == EXPAND_COMPILER
|
||||
|| context == EXPAND_OWNSYNTAX
|
||||
|| context == EXPAND_FILETYPE
|
||||
@@ -2312,6 +2314,11 @@ set_context_by_cmdname(
|
||||
xp->xp_pattern = arg;
|
||||
break;
|
||||
|
||||
case CMD_runtime:
|
||||
xp->xp_context = EXPAND_RUNTIME;
|
||||
xp->xp_pattern = arg;
|
||||
break;
|
||||
|
||||
case CMD_compiler:
|
||||
xp->xp_context = EXPAND_COMPILER;
|
||||
xp->xp_pattern = arg;
|
||||
@@ -3019,6 +3026,12 @@ ExpandFromContext(
|
||||
return ExpandRTDir(pat, DIP_START + DIP_OPT, numMatches, matches,
|
||||
directories);
|
||||
}
|
||||
if (xp->xp_context == EXPAND_RUNTIME)
|
||||
{
|
||||
char *directories[] = {"", NULL};
|
||||
return ExpandRTDir(pat, DIP_START + DIP_OPT + DIP_PRNEXT, numMatches,
|
||||
matches, directories);
|
||||
}
|
||||
if (xp->xp_context == EXPAND_COMPILER)
|
||||
{
|
||||
char *directories[] = {"compiler", NULL};
|
||||
|
Reference in New Issue
Block a user