aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 5c19ce4047..9916ee3bd3 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -21242,6 +21242,7 @@ void ex_echo(exarg_T *eap)
char_u *arg = eap->arg;
typval_T rettv;
bool atstart = true;
+ bool need_clear = true;
const int did_emsg_before = did_emsg;
if (eap->skip)
@@ -21284,7 +21285,7 @@ void ex_echo(exarg_T *eap)
char *tofree = encode_tv2echo(&rettv, NULL);
if (*tofree != NUL) {
msg_ext_set_kind("echo");
- msg_multiline_attr(tofree, echo_attr, true);
+ msg_multiline_attr(tofree, echo_attr, true, &need_clear);
}
xfree(tofree);
}
@@ -21297,7 +21298,9 @@ void ex_echo(exarg_T *eap)
emsg_skip--;
} else {
// remove text that may still be there from the command
- msg_clr_eos();
+ if (need_clear) {
+ msg_clr_eos();
+ }
if (eap->cmdidx == CMD_echo) {
msg_end();
}