Skip to content

Commit 0d677b7

Browse files
committed
fix(zen-mode-nvim): fix incorrect diagnostic mode toggle
1 parent b390e3c commit 0d677b7

File tree

1 file changed

+3
-9
lines changed
  • lua/astrocommunity/editing-support/zen-mode-nvim

1 file changed

+3
-9
lines changed

lua/astrocommunity/editing-support/zen-mode-nvim/init.lua

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ return {
2424
on_open = function() -- disable diagnostics, indent blankline, winbar, and offscreen matchup
2525
local astrocore_avail, astrocore = pcall(require, "astrocore")
2626
if astrocore_avail then
27-
vim.g.diagnostics_mode_old = vim.g.diagnostics_mode
28-
vim.g.diagnostics_mode = 0
29-
vim.diagnostic.config(astrocore.diagnostics[vim.g.diagnostics_mode])
27+
vim.g.diagnostics_mode_old = astrocore.config.features.diagnostics_mode
28+
astrocore.set_diagnostics(0)
3029
end
3130

3231
vim.g.indent_blankline_enabled_old = vim.g.indent_blankline_enabled
@@ -51,12 +50,7 @@ return {
5150
end,
5251
on_close = function() -- restore diagnostics, indent blankline, winbar, and offscreen matchup
5352
local astrocore_avail, astrocore = pcall(require, "astrocore")
54-
if astrocore_avail then
55-
vim.g.diagnostics_mode = vim.g.diagnostics_mode_old
56-
vim.diagnostic.config(
57-
astrocore.diagnostics[vim.g.diagnostics_mode or astrocore.config.features.diagnostics_mode]
58-
)
59-
end
53+
if astrocore_avail then astrocore.set_diagnostics(vim.g.diagnostics_mode_old) end
6054

6155
vim.g.indent_blankline_enabled = vim.g.indent_blankline_enabled_old
6256
vim.g.miniindentscope_disable = vim.g.miniindentscope_disable_old

0 commit comments

Comments
 (0)