fix(messages): avoid empty msg_showmode with 'noshowmode'

This commit is contained in:
Luuk van Baal
2025-01-22 23:13:40 +01:00
committed by luukvbaal
parent 0fd4ef5da7
commit d98827b634
3 changed files with 55 additions and 36 deletions

View File

@@ -3183,7 +3183,11 @@ void msg_ext_flush_showmode(void)
{
// Showmode messages doesn't interrupt normal message flow, so we use
// separate event. Still reuse the same chunking logic, for simplicity.
if (ui_has(kUIMessages)) {
// This is called unconditionally; check if we are emitting, or have
// emitted non-empty "content".
static bool clear = false;
if (ui_has(kUIMessages) && (msg_ext_last_attr != -1 || clear)) {
clear = msg_ext_last_attr != -1;
msg_ext_emit_chunk();
Array *tofree = msg_ext_init_chunks();
ui_call_msg_showmode(*tofree);