comparison src/eval.c @ 15079:a527110d5f56 v8.1.0550

patch 8.1.0550: expression evaluation may repeat an error message commit https://github.com/vim/vim/commit/76a6345433bc2a600689397fb28165a2e5793720 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Nov 28 20:38:37 2018 +0100 patch 8.1.0550: expression evaluation may repeat an error message Problem: Expression evaluation may repeat an error message. (Jason Franklin) Solution: Increment did_emsg and check for the value when giving an error for the echo command.
author Bram Moolenaar <Bram@vim.org>
date Wed, 28 Nov 2018 20:45:07 +0100
parents c5ec5ddbe814
children 0d2138d4c1dc
comparison
equal deleted inserted replaced
15078:344c153e9908 15079:a527110d5f56
7997 char_u *tofree; 7997 char_u *tofree;
7998 char_u *p; 7998 char_u *p;
7999 int needclr = TRUE; 7999 int needclr = TRUE;
8000 int atstart = TRUE; 8000 int atstart = TRUE;
8001 char_u numbuf[NUMBUFLEN]; 8001 char_u numbuf[NUMBUFLEN];
8002 int did_emsg_before = did_emsg;
8002 8003
8003 if (eap->skip) 8004 if (eap->skip)
8004 ++emsg_skip; 8005 ++emsg_skip;
8005 while (*arg != NUL && *arg != '|' && *arg != '\n' && !got_int) 8006 while (*arg != NUL && *arg != '|' && *arg != '\n' && !got_int)
8006 { 8007 {
8014 /* 8015 /*
8015 * Report the invalid expression unless the expression evaluation 8016 * Report the invalid expression unless the expression evaluation
8016 * has been cancelled due to an aborting error, an interrupt, or an 8017 * has been cancelled due to an aborting error, an interrupt, or an
8017 * exception. 8018 * exception.
8018 */ 8019 */
8019 if (!aborting()) 8020 if (!aborting() && did_emsg == did_emsg_before)
8020 EMSG2(_(e_invexpr2), p); 8021 EMSG2(_(e_invexpr2), p);
8021 need_clr_eos = FALSE; 8022 need_clr_eos = FALSE;
8022 break; 8023 break;
8023 } 8024 }
8024 need_clr_eos = FALSE; 8025 need_clr_eos = FALSE;