mirror of
https://github.com/neovim/neovim.git
synced 2026-01-04 02:17:09 +10:00
fix: resolve nil arguments to API functions (#16889)
As revealed by #16745, some functions pass a nil value to API functions, which have been implicitly converted to 0. #16745 breaks this implicit conversion, so explicitly pass a resolved buffer number to these API functions.
This commit is contained in:
@@ -1372,16 +1372,16 @@ function M.reset(namespace, bufnr)
|
||||
diagnostic_cache[iter_bufnr][iter_namespace] = nil
|
||||
M.hide(iter_namespace, iter_bufnr)
|
||||
end
|
||||
end
|
||||
|
||||
vim.api.nvim_buf_call(bufnr, function()
|
||||
vim.api.nvim_command(
|
||||
string.format(
|
||||
"doautocmd <nomodeline> DiagnosticChanged %s",
|
||||
vim.fn.fnameescape(vim.api.nvim_buf_get_name(bufnr))
|
||||
vim.api.nvim_buf_call(iter_bufnr, function()
|
||||
vim.api.nvim_command(
|
||||
string.format(
|
||||
"doautocmd <nomodeline> DiagnosticChanged %s",
|
||||
vim.fn.fnameescape(vim.api.nvim_buf_get_name(iter_bufnr))
|
||||
)
|
||||
)
|
||||
)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
--- Add all diagnostics to the quickfix list.
|
||||
|
||||
Reference in New Issue
Block a user