fix(messages): single msg_show event for multiple :set options #33555

Problem:  :set opt1 opt2... emits a separate event for each option.

Solution: Only set the kind for the first printed option value.
This commit is contained in:
luukvbaal
2025-04-21 16:51:47 +02:00
committed by GitHub
parent 7ba0f623d7
commit 986b92eb07
2 changed files with 22 additions and 6 deletions

View File

@@ -1282,10 +1282,10 @@ static void do_one_set_option(int opt_flags, char **argp, bool *did_show, char *
if (*did_show) {
msg_putchar('\n'); // cursor below last one
} else {
msg_ext_set_kind("list_cmd");
gotocmdline(true); // cursor at status line
*did_show = true; // remember that we did a line
}
msg_ext_set_kind("list_cmd");
showoneopt(&options[opt_idx], opt_flags);
if (p_verbose > 0) {

View File

@@ -1605,12 +1605,11 @@ stack traceback:
it('g< mapping shows recent messages', function()
command('echo "foo" | echo "bar"')
local s1 = [[
^ |
{1:~ }|*4
]]
screen:expect({
grid = s1,
grid = [[
^ |
{1:~ }|*4
]],
messages = {
{
content = { { 'bar' } },
@@ -1644,6 +1643,23 @@ stack traceback:
},
})
end)
it('single event for multiple :set options', function()
command('set sw ts sts')
screen:expect({
grid = [[
^ |
{1:~ }|*4
]],
messages = {
{
content = { { ' shiftwidth=8\n tabstop=8\n softtabstop=0' } },
history = false,
kind = 'list_cmd',
},
},
})
end)
end)
describe('ui/builtin messages', function()