vim-patch:9.0.1734: :runtime completion fails for multiple args (#24767)

Problem: :runtime completion fails for multiple args
Solution: Make it work

closes: vim/vim#12616

be5cdd1d63
This commit is contained in:
zeertzjq
2023-08-18 06:20:06 +08:00
committed by GitHub
parent 9f7e7455c0
commit 19d7fb8efe
3 changed files with 44 additions and 4 deletions

View File

@@ -265,6 +265,15 @@ void set_context_in_runtime_cmd(expand_T *xp, const char *arg)
char *p = skiptowhite(arg);
runtime_expand_flags
= *p != NUL ? get_runtime_cmd_flags((char **)&arg, (size_t)(p - arg)) : 0;
// Skip to the last argument.
while (*(p = skiptowhite_esc(arg)) != NUL) {
if (runtime_expand_flags == 0) {
// When there are multiple arguments and [where] is not specified,
// use an unrelated non-zero flag to avoid expanding [where].
runtime_expand_flags = DIP_ALL;
}
arg = skipwhite(p);
}
xp->xp_context = EXPAND_RUNTIME;
xp->xp_pattern = (char *)arg;
}