diff --git a/src/nvim/message.c b/src/nvim/message.c index 56e491d2e1..94a410fc6f 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -2738,8 +2738,9 @@ static void store_sb_text(const char **sb_str, const char *s, int hl_id, int *sb /// Finished showing messages, clear the scroll-back text on the next message. void may_clear_sb_text(void) { + msg_ext_ui_flush(); // ensure messages until now are emitted do_clear_sb_text = SB_CLEAR_ALL; - do_clear_hist_temp = !msg_ext_append; + do_clear_hist_temp = true; } /// Starting to edit the command line: do not clear messages now. diff --git a/test/functional/lua/ui_event_spec.lua b/test/functional/lua/ui_event_spec.lua index 277394c632..00fef163d6 100644 --- a/test/functional/lua/ui_event_spec.lua +++ b/test/functional/lua/ui_event_spec.lua @@ -439,8 +439,8 @@ describe('vim.ui_attach', function() | {1:~ }|*2 {3: }| - {9:Lua callback:} | - {9:[string ""]:3: foo} | + {9:Error in "msg_show" UI event handler (ns=(UNKNOWN PLUGIN)):} | + {9:Lua: [string ""]:3: foo} | {9:stack traceback:} | {9: [C]: in function 'error'} | {9: [string ""]:3: in function <[string ""]:1>} | diff --git a/test/functional/ui/messages2_spec.lua b/test/functional/ui/messages2_spec.lua index 96eb1dbd27..3acc8a14fc 100644 --- a/test/functional/ui/messages2_spec.lua +++ b/test/functional/ui/messages2_spec.lua @@ -94,8 +94,19 @@ describe('messages2', function() {1:~ }|*12 0,0-1 All| ]]) + -- g< shows messages from last command + feed('g') + screen:expect([[ + | + {1:~ }|*8 + {3: }| + fo^o | + bar | + 1 %a "[No Name]" line 1 | + 1,3 All| + ]]) -- edit_unputchar() does not clear already updated screen #34515. - feed('ixdwi') + feed('qixdwi') screen:expect([[ {18:^"} | {1:~ }|*12