aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-12-02 23:10:26 +0100
committerGitHub <noreply@github.com>2018-12-02 23:10:26 +0100
commitb19403e73e515786d2fcdb23674e3e29e62857b1 (patch)
tree8ecc2ce4abcbb928fbf1b862e27ddefd5546d345 /src/nvim/eval.c
parent109a792e25c6120afc554c74bd539ee19ad21a85 (diff)
parent471129792c67b42e23034b30d35872cb092aa2cc (diff)
downloadrneovim-b19403e73e515786d2fcdb23674e3e29e62857b1.tar.gz
rneovim-b19403e73e515786d2fcdb23674e3e29e62857b1.tar.bz2
rneovim-b19403e73e515786d2fcdb23674e3e29e62857b1.zip
Merge #9291 'vim-patch:8.1.{550,551}'
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index a115e60c7d..5d2bdc210b 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -19538,6 +19538,7 @@ void ex_echo(exarg_T *eap)
typval_T rettv;
bool needclr = true;
bool atstart = true;
+ const int did_emsg_before = did_emsg;
if (eap->skip)
++emsg_skip;
@@ -19552,7 +19553,7 @@ void ex_echo(exarg_T *eap)
// Report the invalid expression unless the expression evaluation
// has been cancelled due to an aborting error, an interrupt, or an
// exception.
- if (!aborting()) {
+ if (!aborting() && did_emsg == did_emsg_before) {
EMSG2(_(e_invexpr2), p);
}
need_clr_eos = false;
@@ -19641,7 +19642,7 @@ void ex_execute(exarg_T *eap)
int ret = OK;
char_u *p;
garray_T ga;
- int save_did_emsg;
+ int save_did_emsg = did_emsg;
ga_init(&ga, 1, 80);
@@ -19655,8 +19656,9 @@ void ex_execute(exarg_T *eap)
* has been cancelled due to an aborting error, an interrupt, or an
* exception.
*/
- if (!aborting())
+ if (!aborting() && did_emsg == save_did_emsg) {
EMSG2(_(e_invexpr2), p);
+ }
ret = FAIL;
break;
}