Mercurial > vim
comparison src/eval.c @ 23191:3e7723bab4e5 v8.2.2141
patch 8.2.2141: a user command with try/catch may not catch an expression error
Commit: https://github.com/vim/vim/commit/8143a53c533bc7776c57e5db063d185bdd5750f3
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Dec 13 20:26:29 2020 +0100
patch 8.2.2141: a user command with try/catch may not catch an expression error
Problem: A user command with try/catch may not catch an expression error.
Solution: When an expression fails check for following "|". (closes https://github.com/vim/vim/issues/7469)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 13 Dec 2020 20:30:04 +0100 |
parents | b6aadb0b3a56 |
children | b545334ae654 |
comparison
equal
deleted
inserted
replaced
23190:42b507fffe8f | 23191:3e7723bab4e5 |
---|---|
2156 && called_emsg == called_emsg_before | 2156 && called_emsg == called_emsg_before |
2157 && (flags & EVAL_CONSTANT) == 0) | 2157 && (flags & EVAL_CONSTANT) == 0) |
2158 semsg(_(e_invexpr2), arg); | 2158 semsg(_(e_invexpr2), arg); |
2159 | 2159 |
2160 // Some of the expression may not have been consumed. Do not check for | 2160 // Some of the expression may not have been consumed. Do not check for |
2161 // a next command to avoid more errors. | 2161 // a next command to avoid more errors, unless "|" is following, which |
2162 // could only be a command separator. | |
2163 if (eap != NULL && skipwhite(p)[0] == '|' && skipwhite(p)[1] != '|') | |
2164 eap->nextcmd = check_nextcmd(p); | |
2162 return FAIL; | 2165 return FAIL; |
2163 } | 2166 } |
2164 | 2167 |
2165 if (eap != NULL) | 2168 if (eap != NULL) |
2166 eap->nextcmd = check_nextcmd(p); | 2169 eap->nextcmd = check_nextcmd(p); |