diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2021-10-09 01:34:18 +0100 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-04-13 21:15:24 +0800 |
commit | 93c72d866b3a41c429dd9d278cda7059ebd4afba (patch) | |
tree | 1ca7caa4271968da4902dfc4d179fc99f0342d31 /src/nvim/eval/userfunc.c | |
parent | b6026337f25cc708e932b21a9e4e64a174a1d9da (diff) | |
download | rneovim-93c72d866b3a41c429dd9d278cda7059ebd4afba.tar.gz rneovim-93c72d866b3a41c429dd9d278cda7059ebd4afba.tar.bz2 rneovim-93c72d866b3a41c429dd9d278cda7059ebd4afba.zip |
vim-patch:8.2.3448: :endtry after function call that throws not found
Problem: :endtry after function call that throws not found.
Solution: Do check for following :endtry if an exception is being thrown.
(closes vim/vim#8889)
https://github.com/vim/vim/commit/1d34189ecb99fa76363c06e1aa815c1075675a1c
Nvim obsoleted did_throw; check current_exception is not NULL instead.
Diffstat (limited to 'src/nvim/eval/userfunc.c')
-rw-r--r-- | src/nvim/eval/userfunc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c index 972bd81117..0fadc0d220 100644 --- a/src/nvim/eval/userfunc.c +++ b/src/nvim/eval/userfunc.c @@ -3017,11 +3017,12 @@ void ex_call(exarg_T *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() || current_exception != NULL) && (!failed || eap->cstack->cs_trylevel > 0)) { // Check for trailing illegal characters and a following command. if (!ends_excmd(*arg)) { - if (!failed) { + if (!failed && !aborting()) { emsg_severe = true; emsg(_(e_trailing)); } |