0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.2.1897: command modifiers are saved and set inconsistently

Problem:    Command modifiers are saved and set inconsistently.
Solution:   Separate parsing and applying command modifiers.  Save values in
            cmdmod_T.
This commit is contained in:
Bram Moolenaar
2020-10-24 17:19:16 +02:00
parent e1be11864d
commit 5661ed6c83
6 changed files with 115 additions and 82 deletions

View File

@@ -1831,12 +1831,12 @@ generate_cmdmods(cctx_T *cctx)
isn_T *isn;
// TODO: use more modifiers in the command
if (cmdmod.msg_silent || cmdmod.emsg_silent)
if (cmdmod.cmod_flags & (CMOD_SILENT | CMOD_ERRSILENT))
{
if ((isn = generate_instr(cctx, ISN_SILENT)) == NULL)
return FAIL;
isn->isn_arg.number = cmdmod.emsg_silent;
cctx->ctx_silent = cmdmod.emsg_silent ? 2 : 1;
isn->isn_arg.number = (cmdmod.cmod_flags & CMOD_ERRSILENT) != 0;
cctx->ctx_silent = (cmdmod.cmod_flags & CMOD_ERRSILENT) ? 2 : 1;
}
return OK;
}
@@ -7187,7 +7187,7 @@ compile_def_function(ufunc_T *ufunc, int set_return_type, cctx_T *outer_cctx)
}
generate_cmdmods(&cctx);
undo_cmdmod(&ea, save_msg_scroll);
undo_cmdmod(save_msg_scroll);
cmdmod = save_cmdmod;
// Skip ":call" to get to the function name.