Patch 8.2.2217

5 views
Skip to first unread message

Bram Moolenaar

unread,
Dec 25, 2020, 1:47:48 PM12/25/20
to vim...@googlegroups.com

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 -- Br...@Moolenaar.net -- 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 ///
Reply all
Reply to author
Forward
0 new messages