Patch 8.2.0267

9 views
Skip to first unread message

Bram Moolenaar

unread,
Feb 16, 2020, 1:43:58 PM2/16/20
to vim...@googlegroups.com

Patch 8.2.0267
Problem: No check for a following command when calling a function fails.
Solution: Also check for a following command when inside a try block.
(closes #5642)
Files: src/userfunc.c, src/testdir/test_user_func.vim


*** ../vim-8.2.0266/src/userfunc.c 2020-02-06 19:25:02.624298180 +0100
--- src/userfunc.c 2020-02-16 19:41:33.605644452 +0100
***************
*** 3554,3560 ****
if (eap->skip)
--emsg_skip;

! if (!failed)
{
// Check for trailing illegal characters and a following command.
if (!ends_excmd(*arg))
--- 3554,3561 ----
if (eap->skip)
--emsg_skip;

! // When inside :try we need to check for following "| catch".
! if (!failed || eap->cstack->cs_trylevel > 0)
{
// Check for trailing illegal characters and a following command.
if (!ends_excmd(*arg))
*** ../vim-8.2.0266/src/testdir/test_user_func.vim 2020-01-30 18:24:47.001204003 +0100
--- src/testdir/test_user_func.vim 2020-02-16 19:39:20.918338671 +0100
***************
*** 162,164 ****
--- 162,168 ----
func Test_user_method()
eval 'bar'->s:addFoo()->assert_equal('barfoo')
endfunc
+
+ func Test_failed_call_in_try()
+ try | call UnknownFunc() | catch | endtry
+ endfunc
*** ../vim-8.2.0266/src/version.c 2020-02-16 17:04:04.934149377 +0100
--- src/version.c 2020-02-16 19:39:44.838211520 +0100
***************
*** 744,745 ****
--- 744,747 ----
{ /* Add new patch number below this line */
+ /**/
+ 267,
/**/

--
From "know your smileys":
!-| I-am-a-Cylon-Centurian-with-one-red-eye-bouncing-back-and-forth

/// 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