assert_equal({'title': 'test'}, getqflist({'title': 1}))
enddef
+def Test_cmd_modifier()
+ tab echo '0'
+ call CheckDefFailure(['5tab echo 3'], 'E16:')
+enddef
+
+def Test_restore_modifiers()
+ # check that when compiling a :def function command modifiers are not messed
+ # up.
+ let lines =<< trim END
+ vim9script
+ set eventignore=
+ autocmd QuickFixCmdPost * copen
+ def AutocmdsDisabled()
+ eval 0
+ enddef
+ func Func()
+ noautocmd call s:AutocmdsDisabled()
+ let g:ei_after = &eventignore
+ endfunc
+ Func()
+ END
+ CheckScriptSuccess(lines)
+ assert_equal('', g:ei_after)
+enddef
+
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
cctx->ctx_line_start = line;
SOURCING_LNUM = cctx->ctx_lnum + 1;
} while (line == NULL || *skipwhite(line) == NUL
- || (skip_comment && vim9_comment_start(skipwhite(line))));
+ || (skip_comment && vim9_comment_start(skipwhite(line))));
return line;
}
*/
for (;;)
{
- exarg_T ea;
- int starts_with_colon = FALSE;
- char_u *cmd;
- int save_msg_scroll = msg_scroll;
+ exarg_T ea;
+ cmdmod_T save_cmdmod;
+ int starts_with_colon = FALSE;
+ char_u *cmd;
+ int save_msg_scroll = msg_scroll;
// Bail out on the first error to avoid a flood of errors and report
// the right line number when inside try/catch.
/*
* COMMAND MODIFIERS
*/
+ save_cmdmod = cmdmod;
if (parse_command_modifiers(&ea, &errormsg, FALSE) == FAIL)
{
if (errormsg != NULL)
}
// TODO: use modifiers in the command
undo_cmdmod(&ea, save_msg_scroll);
- CLEAR_FIELD(cmdmod);
+ cmdmod = save_cmdmod;
// Skip ":call" to get to the function name.
if (checkforcmd(&ea.cmd, "call", 3))