mirror of
https://github.com/neovim/neovim.git
synced 2025-10-15 06:16:08 +00:00
vim-patch:9.1.0774: "shellcmdline" doesn't work with getcompletion() (#30750)
Problem: "shellcmdline" doesn't work with getcompletion().
Solution: Use set_context_for_wildcard_arg() (zeertzjq).
closes: vim/vim#15834
85f36d61e0
This commit is contained in:
@@ -1529,7 +1529,8 @@ static void set_context_for_wildcard_arg(exarg_T *eap, const char *arg, bool use
|
||||
xp->xp_context = EXPAND_FILES;
|
||||
|
||||
// For a shell command more chars need to be escaped.
|
||||
if (usefilter || eap->cmdidx == CMD_bang || eap->cmdidx == CMD_terminal
|
||||
if (usefilter
|
||||
|| (eap != NULL && (eap->cmdidx == CMD_bang || eap->cmdidx == CMD_terminal))
|
||||
|| *complp == EXPAND_SHELLCMDLINE) {
|
||||
#ifndef BACKSLASH_IN_FILENAME
|
||||
xp->xp_shell = true;
|
||||
@@ -3604,6 +3605,11 @@ void f_getcompletion(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
||||
set_context_in_runtime_cmd(&xpc, xpc.xp_pattern);
|
||||
xpc.xp_pattern_len = strlen(xpc.xp_pattern);
|
||||
}
|
||||
if (xpc.xp_context == EXPAND_SHELLCMDLINE) {
|
||||
int context = EXPAND_SHELLCMDLINE;
|
||||
set_context_for_wildcard_arg(NULL, xpc.xp_pattern, false, &xpc, &context);
|
||||
xpc.xp_pattern_len = strlen(xpc.xp_pattern);
|
||||
}
|
||||
|
||||
theend:
|
||||
if (xpc.xp_context == EXPAND_LUA) {
|
||||
|
Reference in New Issue
Block a user