From b4a92aadd274c21a32baa68e2a460910ef9c77f5 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Thu, 16 Jan 2020 15:48:42 +0100 Subject: messages: echo "line1\r\nline2" should not clear line1 --- src/nvim/eval.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/nvim/eval.c') 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(); } -- cgit