File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 39
39
local function from_nvim_lsp ()
40
40
local buffer_severity = {}
41
41
42
- local is_disabled = false
43
- if vim .fn .has " nvim-0.9" == 1 then
44
- -- replacement is_enabled is not present in all 0.10 builds/releases, see #2781
45
- -- wait until 0.11
46
- is_disabled = vim .diagnostic .is_disabled () --- @diagnostic disable-line : deprecated
42
+ -- is_enabled is not present in all 0.10 builds/releases, see #2781
43
+ local is_enabled = false
44
+ if vim .fn .has " nvim-0.10" == 1 and type (vim .diagnostic .is_enabled ) == " function" then
45
+ is_enabled = vim .diagnostic .is_enabled ()
46
+ elseif type (vim .diagnostic .is_disabled ) == " function" then --- @diagnostic disable-line : deprecated
47
+ is_enabled = not vim .diagnostic .is_disabled () --- @diagnostic disable-line : deprecated
47
48
end
48
49
49
- if not is_disabled then
50
+ if is_enabled then
50
51
for _ , diagnostic in ipairs (vim .diagnostic .get (nil , { severity = M .severity })) do
51
52
if diagnostic .severity and diagnostic .bufnr and vim .api .nvim_buf_is_valid (diagnostic .bufnr ) then
52
53
local bufname = uniformize_path (vim .api .nvim_buf_get_name (diagnostic .bufnr ))
You can’t perform that action at this time.
0 commit comments