To: vim_dev@googlegroups.com Subject: Patch 8.2.2217 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@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 ///