Mercurial > vim
comparison src/eval.c @ 15081:0d2138d4c1dc v8.1.0551
patch 8.1.0551: expression evaluation may repeat an error message
commit https://github.com/vim/vim/commit/8ff5af9544a2abc3d344bba017ef96682e098d9d
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Nov 28 21:20:38 2018 +0100
patch 8.1.0551: expression evaluation may repeat an error message
Problem: Expression evaluation may repeat an error message. (Jason
Franklin)
Solution: Check for the value of did_emsg when giving an error
for the :execute command.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 28 Nov 2018 21:30:04 +0100 |
parents | a527110d5f56 |
children | e720da6c932a |
comparison
equal
deleted
inserted
replaced
15080:d0374f91e0d2 | 15081:0d2138d4c1dc |
---|---|
8113 typval_T rettv; | 8113 typval_T rettv; |
8114 int ret = OK; | 8114 int ret = OK; |
8115 char_u *p; | 8115 char_u *p; |
8116 garray_T ga; | 8116 garray_T ga; |
8117 int len; | 8117 int len; |
8118 int save_did_emsg; | 8118 int save_did_emsg = did_emsg; |
8119 | 8119 |
8120 ga_init2(&ga, 1, 80); | 8120 ga_init2(&ga, 1, 80); |
8121 | 8121 |
8122 if (eap->skip) | 8122 if (eap->skip) |
8123 ++emsg_skip; | 8123 ++emsg_skip; |
8129 /* | 8129 /* |
8130 * Report the invalid expression unless the expression evaluation | 8130 * Report the invalid expression unless the expression evaluation |
8131 * has been cancelled due to an aborting error, an interrupt, or an | 8131 * has been cancelled due to an aborting error, an interrupt, or an |
8132 * exception. | 8132 * exception. |
8133 */ | 8133 */ |
8134 if (!aborting()) | 8134 if (!aborting() && did_emsg == save_did_emsg) |
8135 EMSG2(_(e_invexpr2), p); | 8135 EMSG2(_(e_invexpr2), p); |
8136 ret = FAIL; | 8136 ret = FAIL; |
8137 break; | 8137 break; |
8138 } | 8138 } |
8139 | 8139 |