Patch 8.2.2217
Problem:    Vim9: command modifiers not restored in catch block.
Solution:   Restore command modifiers. (closes #7542)
Files:      src/vim9execute.c, src/testdir/test_vim9_cmd.vim


*** ../vim-8.2.2216/src/vim9execute.c   2020-12-24 21:56:37.647479568 +0100
--- src/vim9execute.c   2020-12-25 19:44:55.250053151 +0100
***************
*** 2286,2291 ****
--- 2286,2298 ----
                {
                    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)
*** ../vim-8.2.2216/src/testdir/test_vim9_cmd.vim       2020-12-25 
19:25:41.742706213 +0100
--- src/testdir/test_vim9_cmd.vim       2020-12-25 19:43:38.002329451 +0100
***************
*** 546,551 ****
--- 546,558 ----
  
    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()
*** ../vim-8.2.2216/src/version.c       2020-12-25 19:25:41.746706194 +0100
--- src/version.c       2020-12-25 19:44:27.478152235 +0100
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2217,
  /**/

-- 
Giving a commit hash to refer to a patch is like giving longitude and
lattitude to refer to a city.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202012251847.0BPIldxN3616584%40masaka.moolenaar.net.

Raspunde prin e-mail lui