messages: echo "line1\r\nline2" should not clear line1

This commit is contained in:
Björn Linse
2020-01-16 15:48:42 +01:00
parent 6e78b21623
commit b4a92aadd2
3 changed files with 39 additions and 6 deletions

View File

@@ -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();
}