mirror of
https://github.com/neovim/neovim.git
synced 2025-09-12 22:38:16 +00:00
ex_echo: reuse code from message.c to show arg to user
This commit is contained in:

committed by
Björn Linse

parent
7f2e43c637
commit
67bac681ea
@@ -19593,24 +19593,7 @@ void ex_echo(exarg_T *eap)
|
||||
msg_puts_attr(" ", echo_attr);
|
||||
}
|
||||
char *tofree = encode_tv2echo(&rettv, NULL);
|
||||
const char *p = tofree;
|
||||
if (p != NULL) {
|
||||
for (; *p != NUL && !got_int; ++p) {
|
||||
if (*p == '\n' || *p == '\r' || *p == TAB) {
|
||||
if (*p != TAB && needclr) {
|
||||
/* remove any text still there from the command */
|
||||
msg_clr_eos();
|
||||
needclr = false;
|
||||
}
|
||||
msg_putchar_attr((uint8_t)(*p), echo_attr);
|
||||
} else {
|
||||
int i = (*mb_ptr2len)((const char_u *)p);
|
||||
|
||||
(void)msg_outtrans_len_attr((char_u *)p, i, echo_attr);
|
||||
p += i - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
msg_echo_show(tofree, echo_attr);
|
||||
xfree(tofree);
|
||||
}
|
||||
tv_clear(&rettv);
|
||||
|
Reference in New Issue
Block a user