mirror of
https://github.com/neovim/neovim.git
synced 2025-10-16 23:06:14 +00:00
feat(ui): "append" parameter for "msg_show" UI events
Problem: Consecutive "msg_show" events stemming from an `:echon` command are supposed to be appended without a newline, this information is not encoded in the "msg_show" event. Solution: Add an "append" parameter to the "msg_show" event that is set to true to indicate the message should not start on a new line. Considered alternative: Emit a newline for the common case instead at the start of a new message. That way UIs can more closely follow the logic as it is implemented for the message grid currently. This would be a breaking change. The "append" parameter seems OK.
This commit is contained in:
@@ -3185,7 +3185,8 @@ void msg_ext_ui_flush(void)
|
||||
msg_ext_emit_chunk();
|
||||
if (msg_ext_chunks->size > 0) {
|
||||
Array *tofree = msg_ext_init_chunks();
|
||||
ui_call_msg_show(cstr_as_string(msg_ext_kind), *tofree, msg_ext_overwrite, msg_ext_history);
|
||||
ui_call_msg_show(cstr_as_string(msg_ext_kind), *tofree, msg_ext_overwrite, msg_ext_history,
|
||||
msg_ext_append);
|
||||
if (msg_ext_history || strequal(msg_ext_kind, "return_prompt")) {
|
||||
api_free_array(*tofree);
|
||||
} else {
|
||||
@@ -3205,6 +3206,7 @@ void msg_ext_ui_flush(void)
|
||||
}
|
||||
msg_ext_overwrite = false;
|
||||
msg_ext_history = false;
|
||||
msg_ext_append = false;
|
||||
msg_ext_kind = NULL;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user