Problem: Vim9: command modifiers not restored in catch block.
Solution: Restore command modifiers. (closes #7542)
silent EchoThere()
assert_equal("\nthere", execute(':1messages'))
+
+ try
+ silent eval [][0]
+ catch
+ echomsg "caught"
+ endtry
+ assert_equal("\ncaught", execute(':1messages'))
enddef
def Test_range_after_command_modifier()
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2217,
/**/
2216,
/**/
{
garray_T *trystack = &ectx.ec_trystack;
+ if (restore_cmdmod)
+ {
+ cmdmod.cmod_filter_regmatch.regprog = NULL;
+ undo_cmdmod(&cmdmod);
+ cmdmod = save_cmdmod;
+ restore_cmdmod = FALSE;
+ }
if (trystack->ga_len > 0)
{
trycmd_T *trycmd = ((trycmd_T *)trystack->ga_data)