fix(news): pcall diag when showing news for older Neovim versions

This commit is contained in:
Folke Lemaitre
2024-07-25 10:55:06 +02:00
parent bcbab77f0c
commit 94bf4f9324

View File

@ -82,9 +82,9 @@ function M.open(file, opts)
vim.opt_local.statuscolumn = " "
vim.opt_local.conceallevel = 3
if vim.diagnostic.enable then
vim.diagnostic.enable(false, { bufnr = float.buf })
pcall(vim.diagnostic.enable, false, { bufnr = float.buf })
else
vim.diagnostic.disable(float.buf)
pcall(vim.diagnostic.disable, float.buf)
end
end