fix(messages): disallow source="nvim" progress msg #39315

Problem:  Internal progress messages use the "nvim" source (since
          ff68fd6b), plugins shouldn't be allowed to set the progress
          message source to "nvim". The message ID used for internal
          progress messages is not identifiable as such.
Solution: Disallow setting opts->source to "nvim" with nvim_echo().
          Refactor msg_progress() and callees to bypass nvim_echo().
          Prepend message id for internal progress messages with "nvim.".
This commit is contained in:
luukvbaal
2026-05-06 18:25:25 +02:00
committed by GitHub
parent 27e7aba982
commit dda30fdfbb
9 changed files with 79 additions and 66 deletions

View File

@@ -3888,6 +3888,8 @@ describe('API', function()
eq("Invalid 'id': -1", pcall_err(api.nvim_echo, { { 'foo' } }, false, { id = -1 }))
-- String ids are always allowed (user-defined).
eq('my.msg.id', api.nvim_echo({ { 'foo' } }, false, { id = 'my.msg.id' }))
local opts = { kind = 'progress', source = 'nvim', status = 'success' }
eq("Invalid 'source': 'nvim'", pcall_err(api.nvim_echo, { { '' } }, 1, opts))
end)
it('should clear cmdline message before echo', function()