Skip to content

Commit

Permalink
fix: correctly determine diagnostic enabled state for toggling (#316)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ahorine authored Oct 24, 2024
1 parent cf4ee85 commit e2e870c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/navigator/diagnostics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e2e870c

Please sign in to comment.