From 7fc71698fa178b03accc79aa7eaf2cbf5e523046 Mon Sep 17 00:00:00 2001 From: Allen Horine Date: Wed, 23 Oct 2024 22:02:55 -0400 Subject: [PATCH] fix: correctly determine diagnostic enabled state for toggling Toggling diagnostics doesn't work due to an incorrectly used function always resulting in a true value. Correctly retrieving the current state makes the toggle work as expected. --- lua/navigator/diagnostics.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/navigator/diagnostics.lua b/lua/navigator/diagnostics.lua index cfffbcc..fff8ed2 100644 --- a/lua/navigator/diagnostics.lua +++ b/lua/navigator/diagnostics.lua @@ -433,7 +433,7 @@ M.hide_diagnostic = function() end M.toggle_diagnostics = function() - M.diagnostic_enabled = not vim.diagnostic.enable() + M.diagnostic_enabled = not vim.diagnostic.is_enabled() vim.diagnostic.enable(M.diagnostic_enabled) end