File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change 27
27
local function from_nvim_lsp ()
28
28
local buffer_severity = {}
29
29
30
- for _ , diagnostic in ipairs (vim .diagnostic .get (nil , { severity = M .severity })) do
31
- local buf = diagnostic .bufnr
32
- if vim .api .nvim_buf_is_valid (buf ) then
33
- local bufname = vim .api .nvim_buf_get_name (buf )
34
- local lowest_severity = buffer_severity [bufname ]
35
- if not lowest_severity or diagnostic .severity < lowest_severity then
36
- buffer_severity [bufname ] = diagnostic .severity
30
+ local is_disabled = false
31
+ if vim .fn .has " nvim-0.9" == 1 then
32
+ is_disabled = vim .diagnostic .is_disabled ()
33
+ end
34
+
35
+ if not is_disabled then
36
+ for _ , diagnostic in ipairs (vim .diagnostic .get (nil , { severity = M .severity })) do
37
+ local buf = diagnostic .bufnr
38
+ if vim .api .nvim_buf_is_valid (buf ) then
39
+ local bufname = vim .api .nvim_buf_get_name (buf )
40
+ local lowest_severity = buffer_severity [bufname ]
41
+ if not lowest_severity or diagnostic .severity < lowest_severity then
42
+ buffer_severity [bufname ] = diagnostic .severity
43
+ end
37
44
end
38
45
end
39
46
end
You can’t perform that action at this time.
0 commit comments