Skip to content

Commit e2e870c

Browse files
authored
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.
1 parent cf4ee85 commit e2e870c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: lua/navigator/diagnostics.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ M.hide_diagnostic = function()
433433
end
434434

435435
M.toggle_diagnostics = function()
436-
M.diagnostic_enabled = not vim.diagnostic.enable()
436+
M.diagnostic_enabled = not vim.diagnostic.is_enabled()
437437
vim.diagnostic.enable(M.diagnostic_enabled)
438438
end
439439

0 commit comments

Comments
 (0)