diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-04-20 19:42:10 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-04-20 19:42:10 +0200 |
commit | 2c5ed4e3300378ce76c8d9c3818d6f73e5119f68 (patch) | |
tree | 1fa5e72a63e160710ee6fd59fef09c8f334d0808 /src/ex_eval.c | |
parent | faac410409a8d693a0326ad9db42dca85419a391 (diff) | |
download | vim-git-2c5ed4e3300378ce76c8d9c3818d6f73e5119f68.tar.gz |
patch 8.2.0612: Vim9: no check for space before #commentv8.2.0612
Problem: Vim9: no check for space before #comment.
Solution: Add space checks.
Diffstat (limited to 'src/ex_eval.c')
-rw-r--r-- | src/ex_eval.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ex_eval.c b/src/ex_eval.c index 7ffc145ae..4aa265836 100644 --- a/src/ex_eval.c +++ b/src/ex_eval.c @@ -1021,12 +1021,12 @@ ex_else(exarg_T *eap) if (eap->cmdidx == CMD_elseif) { 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) @@ -1518,7 +1518,7 @@ ex_catch(exarg_T *eap) &cstack->cs_looplevel); } - if (ends_excmd(*eap->arg)) // no argument, catch all errors + if (ends_excmd2(eap->cmd, eap->arg)) // no argument, catch all errors { pat = (char_u *)".*"; end = NULL; @@ -1527,7 +1527,9 @@ ex_catch(exarg_T *eap) else { pat = eap->arg + 1; - end = skip_regexp(pat, *eap->arg, TRUE); + end = skip_regexp_err(pat, *eap->arg, TRUE); + if (end == NULL) + give_up = TRUE; } if (!give_up) @@ -1548,7 +1550,8 @@ ex_catch(exarg_T *eap) if (!skip && (cstack->cs_flags[idx] & CSF_THROWN) && !(cstack->cs_flags[idx] & CSF_CAUGHT)) { - if (end != NULL && *end != NUL && !ends_excmd(*skipwhite(end + 1))) + if (end != NULL && *end != NUL + && !ends_excmd2(end, skipwhite(end + 1))) { emsg(_(e_trailing)); return; |