mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
fix(diagnostic): ensure autocmd always is always sent diagnostics
This commit is contained in:
committed by
Lewis Russell
parent
b6b35cb557
commit
2b21c9c23f
@@ -2714,6 +2714,23 @@ describe('vim.diagnostic', function()
|
||||
eq({}, result)
|
||||
end
|
||||
end)
|
||||
|
||||
it('always passes a table to DiagnosticChanged autocommand', function()
|
||||
local result = exec_lua(function()
|
||||
local changed_diags --- @type vim.Diagnostic[]?
|
||||
vim.api.nvim_create_autocmd('DiagnosticChanged', {
|
||||
buffer = _G.diagnostic_bufnr,
|
||||
callback = function(args)
|
||||
--- @type vim.Diagnostic[]
|
||||
changed_diags = args.data.diagnostics
|
||||
end,
|
||||
})
|
||||
vim.diagnostic.set(_G.diagnostic_ns, _G.diagnostic_bufnr, {})
|
||||
return changed_diags
|
||||
end)
|
||||
eq('table', type(result))
|
||||
eq(0, #result)
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('open_float()', function()
|
||||
|
||||
Reference in New Issue
Block a user