From e2e870c606d28b4247a205972e56a6de2325e34e Mon Sep 17 00:00:00 2001 From: Allen Horine Date: Thu, 24 Oct 2024 06:23:36 -0400 Subject: [PATCH] fix: correctly determine diagnostic enabled state for toggling (#316) 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