nvim: use vim.diagnostic.is_enabled()
instead of deprecated vim.diagnostic.is_disabled()
This commit is contained in:
parent
75b544e352
commit
ff894c77a0
1 changed files with 4 additions and 4 deletions
|
@ -42,11 +42,11 @@ M.open_float = function(opts) vim.diagnostic.open_float(opts) end
|
|||
---Toggle diagnostics in the given buffer.
|
||||
---@param bufnr integer|nil: Buffer number (0 for current buffer, nil for all buffers.
|
||||
M.toggle = function(bufnr)
|
||||
bufnr = bufnr or 0
|
||||
if vim.diagnostic.is_disabled(bufnr) then
|
||||
vim.diagnostic.enable(bufnr)
|
||||
local filter = { bufnr = bufnr or 0 }
|
||||
if vim.diagnostic.is_enabled(filter) then
|
||||
vim.diagnostic.enable(false, filter)
|
||||
else
|
||||
vim.diagnostic.disable(bufnr)
|
||||
vim.diagnostic.enable(true, filter)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue