You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to write a keybind to turn off diagnostics.
vim.g.diagnostics_active=truefunction_G.toggle_diagnostics()
ifvim.g.diagnostics_activethenvim.g.diagnostics_active=falsevim.diagnostic.hide()
vim.lsp.handlers["textDocument/publishDiagnostics"] =function() endvim.notify("Diagnostics are now off", vim.log.levels.INFO, { title="Diagnostics" })
elsevim.g.diagnostics_active=truevim.lsp.handlers["textDocument/publishDiagnostics"] =vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
virtual_text=false,
signs=true,
underline=true,
update_in_insert=true,
}
)
vim.notify("Diagnostics are now no", vim.log.levels.INFO, { title="Diagnostics" })
endendmap('n', '<leader>td', ':call v:lua.toggle_diagnostics()<CR>', {noremap=true, silent=true, desc="Toggle Diagnostics"})
This works for my diagnostics all buffers but does not work for nvim-tree.
So I am trying to find a function which can toggle Diagnostics for nvim-tree in runtime.
Sadly, nvim-tree does not have anything like this.
So I checked the code , and I found this flag.
Then I add enable and enable(false) in my keybindings.
like this
It didn't not work either, and I checked status using :lua print(vim.diagnostic.is_disabled()).
But nvim-tree still won't hide the diagnostic.
Can anybody in this community help me?
The text was updated successfully, but these errors were encountered:
nvim-tree.lua/lua/nvim-tree/diagnostics.lua
Line 44 in 26632f4
I am trying to write a keybind to turn off diagnostics.
This works for my diagnostics all buffers but does not work for nvim-tree.
So I am trying to find a function which can toggle Diagnostics for nvim-tree in runtime.
Sadly, nvim-tree does not have anything like this.
So I checked the code , and I found this flag.
Then I add enable and enable(false) in my keybindings.
like this
It didn't not work either, and I checked status using
:lua print(vim.diagnostic.is_disabled())
.But nvim-tree still won't hide the diagnostic.
Can anybody in this community help me?
The text was updated successfully, but these errors were encountered: