diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-01-26 09:44:15 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-01-26 11:55:32 +0800 |
commit | 6644786db078e019426f90cf85da50e3fa1b6a67 (patch) | |
tree | ad044561cd9b9c336ade9661f54e18fcbd9f7e46 /src/nvim/cmdexpand.c | |
parent | 5ac34cf55db2b00c044fa95f75766dd89dd36ba9 (diff) | |
download | rneovim-6644786db078e019426f90cf85da50e3fa1b6a67.tar.gz rneovim-6644786db078e019426f90cf85da50e3fa1b6a67.tar.bz2 rneovim-6644786db078e019426f90cf85da50e3fa1b6a67.zip |
vim-patch:9.0.1227: no cmdline completion for :runtime
Problem: No cmdline completion for :runtime.
Solution: Add completion for :runtime. (closes vim/vim#11853, closes vim/vim#11447)
Improve the resulting matches.
https://github.com/vim/vim/commit/a6759381a590b2d395e05b109ca9ccfc356be5a8
Diffstat (limited to 'src/nvim/cmdexpand.c')
-rw-r--r-- | src/nvim/cmdexpand.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c index be815151ef..3e06814d6a 100644 --- a/src/nvim/cmdexpand.c +++ b/src/nvim/cmdexpand.c @@ -109,6 +109,7 @@ static bool cmdline_fuzzy_completion_supported(const expand_T *const 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 @@ -1211,6 +1212,7 @@ char *addstar(char *fname, size_t len, int context) if (context == EXPAND_HELP || context == EXPAND_CHECKHEALTH || context == EXPAND_COLORS + || context == EXPAND_RUNTIME || context == EXPAND_COMPILER || context == EXPAND_OWNSYNTAX || context == EXPAND_FILETYPE @@ -2072,6 +2074,11 @@ static const char *set_context_by_cmdname(const char *cmd, cmdidx_T cmdidx, expa xp->xp_pattern = (char *)arg; break; + case CMD_runtime: + xp->xp_context = EXPAND_RUNTIME; + xp->xp_pattern = (char *)arg; + break; + case CMD_compiler: xp->xp_context = EXPAND_COMPILER; xp->xp_pattern = (char *)arg; @@ -2712,6 +2719,11 @@ static int ExpandFromContext(expand_T *xp, char *pat, char ***matches, int *numM char *directories[] = { "colors", NULL }; 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 }; return ExpandRTDir(pat, 0, numMatches, matches, directories); |