fix(messages): verbose message emitted without kind #33305

Problem:  Successive autocmd verbose messages may be emitted without a kind.

Solution: Always set the kind when preparing to emit a verbose message.
(cherry picked from commit 98f5aa2564)
This commit is contained in:
luukvbaal
2025-04-04 14:24:17 +02:00
committed by github-actions[bot]
parent e3506ede27
commit 3df9db58dc
2 changed files with 46 additions and 2 deletions

View File

@ -3355,8 +3355,8 @@ void verbose_enter(void)
}
if (msg_ext_kind != verbose_kind) {
pre_verbose_kind = msg_ext_kind;
msg_ext_set_kind("verbose");
}
msg_ext_set_kind("verbose");
}
/// After giving verbose message.

View File

@ -372,6 +372,50 @@ describe('ui/ext_messages', function()
})
feed('<CR>')
exec([[
set verbose=9
augroup verbose
autocmd BufEnter * echoh "BufEnter"
autocmd BufWinEnter * bdelete
augroup END
]])
feed(':edit! foo<CR>')
screen:expect({
grid = s2,
cmdline = { { abort = false } },
messages = {
{
content = { { 'Executing BufEnter Autocommands for "*"' } },
history = true,
kind = 'verbose',
},
{
content = { { 'autocommand echoh "BufEnter"\n' } },
history = true,
kind = 'verbose',
},
{
content = { { 'Executing BufWinEnter Autocommands for "*"' } },
history = true,
kind = 'verbose',
},
{
content = { { 'autocommand bdelete\n' } },
history = true,
kind = 'verbose',
},
{
content = { { 'Press ENTER or type command to continue', 6, 18 } },
history = false,
kind = 'return_prompt',
},
},
})
feed('<CR>')
command('autocmd! verbose')
command('augroup! verbose')
command('set verbose=0')
n.add_builddir_to_rtp()
feed(':help<CR>:tselect<CR>')
screen:expect({
@ -406,7 +450,7 @@ describe('ui/ext_messages', function()
screen.messages = {}
end,
})
feed('<CR>:bd<CR>')
feed('<CR>:bdelete<CR>$')
-- kind=shell for :!cmd messages
local cmd = t.is_os('win') and 'echo stdout& echo stderr>&2& exit 3'