commit 2415d8f4247e01346a08487f290c44d01ef01f21
parent 2b421d518faec9e1b0a6d1c46026d2f13f4fb73f
Author: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com>
Date: Thu, 4 Sep 2025 20:26:18 +0600
fix(progress): message-id not sent to ui with history set to false
Diffstat:
2 files changed, 38 insertions(+), 1 deletion(-)
diff --git a/src/nvim/message.c b/src/nvim/message.c
@@ -368,6 +368,7 @@ MsgID msg_multihl(MsgID id, HlMessage hl_msg, const char *kind, bool history, bo
msg_id_next = id.data.integer + 1;
}
}
+ msg_ext_id = id;
// progress message are special displayed as "title: percent% msg"
if (strequal(kind, "progress") && msg_data) {
@@ -1161,7 +1162,6 @@ static void msg_hist_add_multihl(MsgID msg_id, HlMessage msg, bool temp, Message
msg_hist_last = entry;
msg_ext_history = true;
- msg_ext_id = msg_id;
msg_hist_clear(msg_hist_max);
}
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua
@@ -3640,4 +3640,41 @@ describe('progress-message', function()
{6:TestSuit}: {19: 10% }test-message |
]])
end)
+
+ it('works with history off', function()
+ api.nvim_echo({ { 'test-message' } }, false, {
+ kind = 'progress',
+ title = 'TestSuit',
+ percent = 10,
+ status = 'running',
+ })
+
+ screen:expect({
+ grid = [[
+ ^ |
+ {1:~ }|*4
+ ]],
+ messages = {
+ {
+ content = {
+ { 'TestSuit', 6, 'MoreMsg' },
+ { ': ' },
+ { ' 10% ', 19, 'WarningMsg' },
+ { 'test-message' },
+ },
+ id = 1,
+ kind = 'progress',
+ },
+ },
+ })
+
+ assert_progress_autocmd({
+ text = { 'test-message' },
+ percent = 10,
+ status = 'running',
+ title = 'TestSuit',
+ id = 1,
+ data = {},
+ }, 'progress autocmd receives progress messages')
+ end)
end)