0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

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 #8889)
This commit is contained in:
Bram Moolenaar
2021-09-18 15:25:52 +02:00
parent d2b98ab4ec
commit 1d34189ecb
3 changed files with 34 additions and 4 deletions

View File

@@ -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);