diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-11-05 12:00:26 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-05 12:00:26 +0800 |
commit | 50048051565f84b8b75a50f4cfdc5147f861e42b (patch) | |
tree | edf413e2f839c19f48dcd93be5c76afa0cf597e3 /src/nvim/ex_eval.c | |
parent | 81722896e4a6d17dbf33325d344253e44a11e9ed (diff) | |
parent | 199c7c28989a3c36447ef56b71c7b84756950a11 (diff) | |
download | rneovim-50048051565f84b8b75a50f4cfdc5147f861e42b.tar.gz rneovim-50048051565f84b8b75a50f4cfdc5147f861e42b.tar.bz2 rneovim-50048051565f84b8b75a50f4cfdc5147f861e42b.zip |
Merge pull request #20939 from zeertzjq/vim-8.2.0502
vim-patch:8.2.{0502,0612}
Diffstat (limited to 'src/nvim/ex_eval.c')
-rw-r--r-- | src/nvim/ex_eval.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c index 2d6b236007..8c2ac895cb 100644 --- a/src/nvim/ex_eval.c +++ b/src/nvim/ex_eval.c @@ -900,12 +900,12 @@ void ex_else(exarg_T *eap) if (eap->cmdidx == CMD_elseif) { bool error; result = eval_to_bool(eap->arg, &error, &eap->nextcmd, skip); + // When throwing error exceptions, we want to throw always the first // of several errors in a row. This is what actually happens when // a conditional error was detected above and there is another failure // when parsing the expression. Since the skip flag is set in this // case, the parsing error will be ignored by emsg(). - if (!skip && !error) { if (result) { cstack->cs_flags[cstack->cs_idx] = CSF_ACTIVE | CSF_TRUE; @@ -1296,7 +1296,10 @@ void ex_catch(exarg_T *eap) eap->nextcmd = find_nextcmd(eap->arg); } else { pat = eap->arg + 1; - end = skip_regexp(pat, *eap->arg, true, NULL); + end = skip_regexp_err(pat, *eap->arg, true); + if (end == NULL) { + give_up = true; + } } if (!give_up) { |