mirror of
https://github.com/neovim/neovim.git
synced 2026-01-04 18:37:02 +10:00
fix(ui)!: decouple ext_messages from message grid #27963
Problem: ext_messages is implemented to mimic the message grid
implementation w.r.t. scrolling messages, clearing scrolled
messages, hit-enter-prompts and replacing a previous message.
Meanwhile, an ext_messages UI may not be implemented in a way
where these events are wanted. Moreover, correctness of these
events even assuming a "scrolled message" implementation
depends on fragile "currently visible messages" global state,
which already isn't correct after a previous message was
supposed to have been overwritten (because that should not only
happen when `msg_scroll == false`).
Solution: - No longer attempt to keep track of the currently visible
messages: remove the `msg_ext(_history)_visible` variables.
UIs may remove messages pre-emptively (timer based), or never
show messages that don't fit a certain area in the first place.
- No longer emit the `msg(_history)_clear` events to clear
"scrolled" messages. This opens up the `msg_clear` event to
be emitted when messages should actually be cleared (e.g.
when the screen is cleared). May also be useful to emit before
the first message in an event loop cycle as a hint to the UI
that it is a new batch of messages (vim._extui currently
schedules an event to determine that).
- Set `replace_last` explicitly at the few callsites that want
this to be set to true to replace an incomplete status message.
- Don't store a "keep" message to be re-emitted.
This commit is contained in:
@@ -31,10 +31,12 @@ enum {
|
||||
extern MessageHistoryEntry *msg_hist_last;
|
||||
|
||||
EXTERN bool msg_ext_need_clear INIT( = false);
|
||||
// Set to true to force grouping a set of message chunks into a single `cmdline_show` event.
|
||||
/// Set to true to force grouping a set of message chunks into a single `cmdline_show` event.
|
||||
EXTERN bool msg_ext_skip_flush INIT( = false);
|
||||
// Set to true when message should be appended to previous message line.
|
||||
/// Set to true when message should be appended to previous message line.
|
||||
EXTERN bool msg_ext_append INIT( = false);
|
||||
/// Set to true when previous message should be overwritten.
|
||||
EXTERN bool msg_ext_overwrite INIT( = false);
|
||||
|
||||
/// allocated grid for messages. Used unless ext_messages is active.
|
||||
/// See also the description at msg_scroll_flush()
|
||||
|
||||
Reference in New Issue
Block a user