diff --git a/src/nvim/message.c b/src/nvim/message.c index 694f8835fd..ff9065b712 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -2340,6 +2340,7 @@ void msg_puts_len(const char *const str, const ptrdiff_t len, int hl_id, bool hi // Don't print anything when using ":silent cmd" or empty message. if (msg_silent != 0 || *str == NUL) { if (*str == NUL && ui_has(kUIMessages)) { + msg_ext_ui_flush(); // ensure messages until now are emitted ui_call_msg_show(cstr_as_string("empty"), (Array)ARRAY_DICT_INIT, false, false, false, INTEGER_OBJ(-1), (String)STRING_INIT); cmdline_was_last_drawn = false; diff --git a/test/functional/ui/messages2_spec.lua b/test/functional/ui/messages2_spec.lua index 5c11b8a3d5..9350b877e4 100644 --- a/test/functional/ui/messages2_spec.lua +++ b/test/functional/ui/messages2_spec.lua @@ -389,6 +389,15 @@ describe('messages2', function() ]]) end) + it('empty kind after message that does not flush immediately', function() + command('echon "foo" | echo') + screen:expect([[ + ^ | + {1:~ }|*12 + foo | + ]]) + end) + it("deleting buffer restores 'buftype'", function() feed(':%bdelete') screen:expect([[