aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r--runtime/lua/vim/diagnostic.lua10
-rw-r--r--runtime/lua/vim/lsp/diagnostic.lua3
2 files changed, 7 insertions, 6 deletions
diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua
index cdf349dbdd..015db54d34 100644
--- a/runtime/lua/vim/diagnostic.lua
+++ b/runtime/lua/vim/diagnostic.lua
@@ -671,12 +671,14 @@ function M.set(namespace, bufnr, diagnostics, opts)
M.show(namespace, bufnr, diagnostics, opts)
end
- vim.api.nvim_command("doautocmd <nomodeline> User DiagnosticsChanged")
+ vim.api.nvim_command(
+ string.format("doautocmd <nomodeline> DiagnosticChanged %s", vim.api.nvim_buf_get_name(bufnr))
+ )
end
--- Get namespace metadata.
---
----@param ns number Diagnostic namespace
+---@param namespace number Diagnostic namespace
---@return table Namespace metadata
function M.get_namespace(namespace)
vim.validate { namespace = { namespace, 'n' } }
@@ -1331,7 +1333,9 @@ function M.reset(namespace, bufnr)
end
end
- vim.api.nvim_command("doautocmd <nomodeline> User DiagnosticsChanged")
+ vim.api.nvim_command(
+ string.format("doautocmd <nomodeline> DiagnosticChanged %s", vim.api.nvim_buf_get_name(bufnr))
+ )
end
--- Add all diagnostics to the quickfix list.
diff --git a/runtime/lua/vim/lsp/diagnostic.lua b/runtime/lua/vim/lsp/diagnostic.lua
index 76a4dc30b7..3b214c49f9 100644
--- a/runtime/lua/vim/lsp/diagnostic.lua
+++ b/runtime/lua/vim/lsp/diagnostic.lua
@@ -220,9 +220,6 @@ function M.on_publish_diagnostics(_, result, ctx, config)
end
vim.diagnostic.set(namespace, bufnr, diagnostic_lsp_to_vim(diagnostics, bufnr, client_id))
-
- -- Keep old autocmd for back compat. This should eventually be removed.
- vim.api.nvim_command("doautocmd <nomodeline> User LspDiagnosticsChanged")
end
--- Clear diagnotics and diagnostic cache.