diff src/vim9compile.c @ 22697:c996700d569f v8.2.1897

patch 8.2.1897: command modifiers are saved and set inconsistently Commit: https://github.com/vim/vim/commit/5661ed6c833e05467cab33cb9b1c535e7e5cc570 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 24 17:19:16 2020 +0200 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.
author Bram Moolenaar <Bram@vim.org>
date Sat, 24 Oct 2020 17:30:04 +0200
parents dda110a14be4
children e82579016863
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -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
 	}
 	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.