mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(messages): attaching/detaching ext_messages causes asserts #31952
Problem: Assert hit related to message kind, which is reset after a ext_messages UI is forcibly detached, so the assertion is expectedly false. Assert hit related to message grid variables after an ext_messages UI attaches while message grid is scrolled. Solution: Don't check message kind assertion if no ext_messages UI is attached. Flush message grid when first/last ext_messages UI attaches/detaches.
This commit is contained in:
parent
cb02c20569
commit
37c77ab46b
@ -312,7 +312,7 @@ void msg_multihl(HlMessage hl_msg, const char *kind, bool history, bool err)
|
|||||||
} else {
|
} else {
|
||||||
msg_multiline(chunk.text, chunk.hl_id, true, false, &need_clear);
|
msg_multiline(chunk.text, chunk.hl_id, true, false, &need_clear);
|
||||||
}
|
}
|
||||||
assert(msg_ext_kind == kind);
|
assert(!ui_has(kUIMessages) || msg_ext_kind == kind);
|
||||||
}
|
}
|
||||||
if (history && kv_size(hl_msg)) {
|
if (history && kv_size(hl_msg)) {
|
||||||
add_msg_hist_multihl(NULL, 0, 0, true, hl_msg);
|
add_msg_hist_multihl(NULL, 0, 0, true, hl_msg);
|
||||||
|
@ -223,10 +223,10 @@ void ui_refresh(void)
|
|||||||
// Reset 'cmdheight' for all tabpages when ext_messages toggles.
|
// Reset 'cmdheight' for all tabpages when ext_messages toggles.
|
||||||
if (had_message != ui_ext[kUIMessages]) {
|
if (had_message != ui_ext[kUIMessages]) {
|
||||||
set_option_value(kOptCmdheight, NUMBER_OPTVAL(had_message), 0);
|
set_option_value(kOptCmdheight, NUMBER_OPTVAL(had_message), 0);
|
||||||
command_height();
|
|
||||||
FOR_ALL_TABS(tp) {
|
FOR_ALL_TABS(tp) {
|
||||||
tp->tp_ch_used = had_message;
|
tp->tp_ch_used = had_message;
|
||||||
}
|
}
|
||||||
|
msg_scroll_flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ui_active()) {
|
if (!ui_active()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user