diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-09-18 15:25:52 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-09-18 15:25:52 +0200 |
commit | 1d34189ecb99fa76363c06e1aa815c1075675a1c (patch) | |
tree | 8a103c189a514d84c27fe765facf7406f0d9059f /src/userfunc.c | |
parent | d2b98ab4ecf168514ae622948e3749dea7671946 (diff) | |
download | vim-git-1d34189ecb99fa76363c06e1aa815c1075675a1c.tar.gz |
patch 8.2.3448: :endtry after function call that throws not foundv8.2.3448
Problem: :endtry after function call that throws not found.
Solution: Do check for following :endtry if an exception is being thrown.
(closes #8889)
Diffstat (limited to 'src/userfunc.c')
-rw-r--r-- | src/userfunc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/userfunc.c b/src/userfunc.c index dc0a939eb..ab441405c 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -5011,14 +5011,16 @@ ex_call(exarg_T *eap) --emsg_skip; clear_evalarg(&evalarg, eap); - // When inside :try we need to check for following "| catch". - if (!aborting() && (!failed || eap->cstack->cs_trylevel > 0)) + // When inside :try we need to check for following "| catch" or "| endtry". + // Not when there was an error, but do check if an exception was thrown. + if ((!aborting() || did_throw) + && (!failed || eap->cstack->cs_trylevel > 0)) { // Check for trailing illegal characters and a following command. arg = skipwhite(arg); if (!ends_excmd2(eap->arg, arg)) { - if (!failed) + if (!failed && !aborting()) { emsg_severe = TRUE; semsg(_(e_trailing_arg), arg); |