Skip to content

Commit 71f1841

Browse files
authored
fix: add a nil check to vim.diagnostic.is_disabled (#1159)
1 parent 54fe2a5 commit 71f1841

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lua/neo-tree/utils/init.lua

+4-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,10 @@ M.get_diagnostic_counts = function()
233233
for ns, _ in pairs(vim.diagnostic.get_namespaces()) do
234234
for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do
235235
local success, file_name = pcall(vim.api.nvim_buf_get_name, bufnr)
236-
if success and not vim.diagnostic.is_disabled(bufnr, ns) then
236+
-- TODO, remove is_disabled nil check when dropping support for 0.8
237+
if
238+
success and vim.diagnostic.is_disabled == nil or not vim.diagnostic.is_disabled(bufnr, ns)
239+
then
237240
for severity, _ in ipairs(vim.diagnostic.severity) do
238241
local diagnostics = vim.diagnostic.get(bufnr, { namespace = ns, severity = severity })
239242

0 commit comments

Comments
 (0)