refactor: diag

This commit is contained in:
Folke Lemaitre 2024-07-15 15:32:01 +02:00
parent 4e52d31187
commit b7bcac9c9d
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 4 additions and 9 deletions

View file

@ -112,17 +112,11 @@ M.number = {
end,
}
local enabled = true
---@type lazyvim.Toggle
M.diagnostics = {
name = "Diagnostics",
get = function()
if vim.diagnostic.is_enabled then
enabled = vim.diagnostic.is_enabled()
elseif vim.diagnostic.is_disabled then
enabled = not vim.diagnostic.is_disabled()
end
return enabled
return vim.diagnostic.is_enabled and vim.diagnostic.is_enabled()
end,
set = vim.diagnostic.enable,
}