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.
diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index 5a47f6a..4fe9bd3 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -56,6 +56,7 @@
&& 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 @@
// 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 @@
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 @@
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};