mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
feat(toggle-diagnostics): change logic based on vim.diagnostic.is_disabled
After discussion in #2215, I thought maybe it would be beneficial if we could change the logic of the `toggle-diagnostics` function based on if the user has disabled diagnostics in his own configuration.
This commit is contained in:
parent
879e29504d
commit
88e75615b1
1 changed files with 3 additions and 3 deletions
|
|
@ -41,10 +41,10 @@ function M.number()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local enabled = true
|
local status = vim.diagnostic.is_disabled()
|
||||||
function M.diagnostics()
|
function M.diagnostics()
|
||||||
enabled = not enabled
|
status = not status
|
||||||
if enabled then
|
if not status then
|
||||||
vim.diagnostic.enable()
|
vim.diagnostic.enable()
|
||||||
Util.info("Enabled diagnostics", { title = "Diagnostics" })
|
Util.info("Enabled diagnostics", { title = "Diagnostics" })
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue