mirror of
https://github.com/nvim-tree/nvim-tree.lua
synced 2024-09-16 14:34:03 +02:00
refactor(#2787): replace deprecated
This commit is contained in:
parent
c7add15dd4
commit
b6b4c32fcb
1 changed files with 6 additions and 4 deletions
|
@ -39,12 +39,14 @@ end
|
|||
local function from_nvim_lsp()
|
||||
local buffer_severity = {}
|
||||
|
||||
local is_disabled = false
|
||||
if vim.fn.has "nvim-0.9" == 1 then
|
||||
is_disabled = vim.diagnostic.is_disabled()
|
||||
local is_enabled
|
||||
if vim.fn.has "nvim-0.10" == 1 then
|
||||
is_enabled = vim.diagnostic.is_enabled()
|
||||
else
|
||||
is_enabled = not vim.diagnostic.is_disabled() ---@diagnostic disable-line: deprecated
|
||||
end
|
||||
|
||||
if not is_disabled then
|
||||
if is_enabled then
|
||||
for _, diagnostic in ipairs(vim.diagnostic.get(nil, { severity = M.severity })) do
|
||||
if diagnostic.severity and diagnostic.bufnr and vim.api.nvim_buf_is_valid(diagnostic.bufnr) then
|
||||
local bufname = uniformize_path(vim.api.nvim_buf_get_name(diagnostic.bufnr))
|
||||
|
|
Loading…
Reference in a new issue