vim-patch:9.0.1708: getcompletion() failes for user-defined commands (#24707)

Problem: getcompletion() failes for user-defined commands
Solution: set context for completion function

closes: vim/vim#12681
closes: vim/vim#12680

8ef1fbc0c3

Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2023-08-14 06:47:32 +08:00
committed by GitHub
parent 06bce8bf5c
commit fbc644ba31
2 changed files with 13 additions and 0 deletions

View File

@@ -296,6 +296,9 @@ const char *set_context_in_user_cmdarg(const char *cmd FUNC_ATTR_UNUSED, const c
return set_context_in_menu_cmd(xp, cmd, (char *)arg, forceit);
}
if (context == EXPAND_COMMANDS) {
if (xp->xp_context == EXPAND_NOTHING) {
xp->xp_context = context;
}
return arg;
}
if (context == EXPAND_MAPPINGS) {