mirror of
https://github.com/neovim/neovim.git
synced 2025-10-13 13:26:06 +00:00
feat(ui): emit "msg_clear" event after clearing the screen (#34035)
Problem: ext_messages cannot tell when the screen was cleared, which is needed to clear visible messages. An empty message is also never emitted, but clears messages from the message grid. Solution: Repurpose the "msg_clear" event to be emitted when the screen was cleared. Emit an empty message with the `empty` kind to hint to a UI to clear the cmdline area.
This commit is contained in:
@@ -1405,10 +1405,16 @@ static void list_one_var(dictitem_T *v, const char *prefix, int *first)
|
||||
static void list_one_var_a(const char *prefix, const char *name, const ptrdiff_t name_len,
|
||||
const VarType type, const char *string, int *first)
|
||||
{
|
||||
msg_ext_set_kind("list_cmd");
|
||||
if (*first) {
|
||||
msg_ext_set_kind("list_cmd");
|
||||
msg_start();
|
||||
} else {
|
||||
msg_putchar('\n');
|
||||
}
|
||||
// don't use msg() to avoid overwriting "v:statusmsg"
|
||||
msg_start();
|
||||
msg_puts(prefix);
|
||||
if (*prefix != NUL) {
|
||||
msg_puts(prefix);
|
||||
}
|
||||
if (name != NULL) { // "a:" vars don't have a name stored
|
||||
msg_puts_len(name, name_len, 0, false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user