summaryrefslogtreecommitdiffstats
path: root/src/cmdexpand.c
diff options
context:
space:
mode:
authorroot <root@acermirko.emind.lan>2023-01-21 21:56:06 +0000
committerBram Moolenaar <Bram@vim.org>2023-01-21 21:56:06 +0000
commita6759381a590b2d395e05b109ca9ccfc356be5a8 (patch)
tree10c853b311f065148c4b707f052e569677e3e818 /src/cmdexpand.c
parent51b2fc2ef5183487dc1acd9f526e904e5bda7814 (diff)
patch 9.0.1227: no cmdline completion for :runtimev9.0.1227
Problem: No cmdline completion for :runtime. Solution: Add completion for :runtime. (closes #11853, closes #11447) Improve the resulting matches.
Diffstat (limited to 'src/cmdexpand.c')
-rw-r--r--src/cmdexpand.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index 5a47f6a24a..4fe9bd35bc 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -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};