# HG changeset patch # User Bram Moolenaar # Date 1581878704 -3600 # Node ID c6c9d91d82900e541592dbc0a9c9a4f7ea9f25dd # Parent f3d0c7552be65632fce36748ef2eaf78ca9c5bd8 patch 8.2.0267: no check for a following cmd when calling a function fails Commit: https://github.com/vim/vim/commit/e51bb17dd0d51384375830ee2a1df30c08121443 Author: Bram Moolenaar Date: Sun Feb 16 19:42:23 2020 +0100 patch 8.2.0267: no check for a following cmd when calling a function fails 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) diff --git a/src/testdir/test_user_func.vim b/src/testdir/test_user_func.vim --- a/src/testdir/test_user_func.vim +++ b/src/testdir/test_user_func.vim @@ -162,3 +162,7 @@ endfunc func Test_user_method() eval 'bar'->s:addFoo()->assert_equal('barfoo') endfunc + +func Test_failed_call_in_try() + try | call UnknownFunc() | catch | endtry +endfunc diff --git a/src/userfunc.c b/src/userfunc.c --- a/src/userfunc.c +++ b/src/userfunc.c @@ -3554,7 +3554,8 @@ ex_call(exarg_T *eap) if (eap->skip) --emsg_skip; - if (!failed) + // 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)) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -743,6 +743,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 267, +/**/ 266, /**/ 265,