fix: deprecation warning on diagnostic.is_disabled

This commit is contained in:
Folke Lemaitre 2024-05-17 09:07:01 +02:00
parent 03653dbe35
commit 960ec8079b
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -43,7 +43,9 @@ local enabled = true
function M.diagnostics()
-- if this Neovim version supports checking if diagnostics are enabled
-- then use that for the current state
if vim.diagnostic.is_disabled then
if vim.diagnostic.is_enabled then
enabled = vim.diagnostic.is_enabled()
elseif vim.diagnostic.is_disabled then
enabled = not vim.diagnostic.is_disabled()
end
enabled = not enabled