1
0
forked from aniani/vim

patch 9.0.0140: execute() does not use the "legacy" command modifier

Problem:    execute() does not use the "legacy" command modifier.
Solution:   pass the command modifier in sticky_cmdmod_flags. (Kota Kato,
            closes #10845)
This commit is contained in:
Kota Kato
2022-08-04 18:50:14 +01:00
committed by Bram Moolenaar
parent 398649ee44
commit 3d3f6ac098
3 changed files with 43 additions and 0 deletions

View File

@@ -3929,6 +3929,7 @@ execute_common(typval_T *argvars, typval_T *rettv, int arg_off)
int save_redir_off = redir_off;
garray_T save_ga;
int save_msg_col = msg_col;
int save_sticky_cmdmod_flags = sticky_cmdmod_flags;
int echo_output = FALSE;
rettv->vval.v_string = NULL;
@@ -3985,6 +3986,9 @@ execute_common(typval_T *argvars, typval_T *rettv, int arg_off)
if (!echo_output)
msg_col = 0; // prevent leading spaces
// For "legacy call execute('cmd')" and "vim9cmd execute('cmd')" apply the
// command modifiers to "cmd".
sticky_cmdmod_flags = cmdmod.cmod_flags & (CMOD_LEGACY | CMOD_VIM9CMD);
if (cmd != NULL)
do_cmdline_cmd(cmd);
else
@@ -3997,6 +4001,7 @@ execute_common(typval_T *argvars, typval_T *rettv, int arg_off)
DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT|DOCMD_KEYTYPED);
--list->lv_refcount;
}
sticky_cmdmod_flags = save_sticky_cmdmod_flags;
// Need to append a NUL to the result.
if (ga_grow(&redir_execute_ga, 1) == OK)