comparison src/userfunc.c @ 25826:5040fae521f6 v8.2.3448

patch 8.2.3448: :endtry after function call that throws not found Commit: https://github.com/vim/vim/commit/1d34189ecb99fa76363c06e1aa815c1075675a1c Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 18 15:25:52 2021 +0200 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)
author Bram Moolenaar <Bram@vim.org>
date Sat, 18 Sep 2021 15:30:04 +0200
parents e855eba4ac39
children f773ef3c641d
comparison
equal deleted inserted replaced
25825:9b12bc041450 25826:5040fae521f6
5009 } 5009 }
5010 if (eap->skip) 5010 if (eap->skip)
5011 --emsg_skip; 5011 --emsg_skip;
5012 clear_evalarg(&evalarg, eap); 5012 clear_evalarg(&evalarg, eap);
5013 5013
5014 // When inside :try we need to check for following "| catch". 5014 // When inside :try we need to check for following "| catch" or "| endtry".
5015 if (!aborting() && (!failed || eap->cstack->cs_trylevel > 0)) 5015 // Not when there was an error, but do check if an exception was thrown.
5016 if ((!aborting() || did_throw)
5017 && (!failed || eap->cstack->cs_trylevel > 0))
5016 { 5018 {
5017 // Check for trailing illegal characters and a following command. 5019 // Check for trailing illegal characters and a following command.
5018 arg = skipwhite(arg); 5020 arg = skipwhite(arg);
5019 if (!ends_excmd2(eap->arg, arg)) 5021 if (!ends_excmd2(eap->arg, arg))
5020 { 5022 {
5021 if (!failed) 5023 if (!failed && !aborting())
5022 { 5024 {
5023 emsg_severe = TRUE; 5025 emsg_severe = TRUE;
5024 semsg(_(e_trailing_arg), arg); 5026 semsg(_(e_trailing_arg), arg);
5025 } 5027 }
5026 } 5028 }