Skip to content

Commit

Permalink
fix(diagnostics): ignore disabled diagnostics (#816)
Browse files Browse the repository at this point in the history
* Ignore disabled diagnostics

* Add nil check to vim.diagnostic.is_disabled
  • Loading branch information
sidequestboy committed Sep 20, 2023
1 parent 81cd04f commit 8a51c4b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lua/bufferline/diagnostics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@ local get_diagnostics = {
local results = {}
local diagnostics = vim.diagnostic.get()
for _, d in pairs(diagnostics) do
if not results[d.bufnr] then results[d.bufnr] = {} end
table.insert(results[d.bufnr], d)
-- TODO remove is_disabled nil check when 0.9 is stable
if vim.diagnostic.is_disabled == nil or not vim.diagnostic.is_disabled(d.bufnr, d.namespace) then
if not results[d.bufnr] then results[d.bufnr] = {} end
table.insert(results[d.bufnr], d)
end
end
return results
end,
Expand Down

0 comments on commit 8a51c4b

Please sign in to comment.