diff src/usercmd.c @ 32796:e98fc0c439aa v9.0.1714

patch 9.0.1714: getcompletion() "cmdline" fails after :autocmd Commit: https://github.com/vim/vim/commit/e4c79d36150431ffb97cb8952ec482af2e57f228 Author: zeertzjq <zeertzjq@outlook.com> Date: Tue Aug 15 22:41:53 2023 +0200 patch 9.0.1714: getcompletion() "cmdline" fails after :autocmd Problem: getcompletion() "cmdline" fails after :autocmd Solution: Use set_cmd_context() instead of set_one_cmd_context(). closes: #12804 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
author Christian Brabandt <cb@256bit.org>
date Tue, 15 Aug 2023 23:00:03 +0200
parents a61007fbc2a3
children 306f51627f50
line wrap: on
line diff
--- a/src/usercmd.c
+++ b/src/usercmd.c
@@ -329,11 +329,7 @@ set_context_in_user_cmdarg(
 	return set_context_in_menu_cmd(xp, cmd, arg, forceit);
 #endif
     if (context == EXPAND_COMMANDS)
-    {
-	if (xp->xp_context == EXPAND_NOTHING)
-	    xp->xp_context = context;
 	return arg;
-    }
     if (context == EXPAND_MAPPINGS)
 	return set_context_in_map_cmd(xp, (char_u *)"map", arg, forceit, FALSE,
 							FALSE, CMD_map);