fix: use nil for the default diagnostics severity (#2662)

* fix: use nil for the default diagnostics severity

https://github.com/neovim/neovim/pull/24736 has introduced a new syntax
for severity format in `vim.diagnostic.get()`.

Fix #2661

* fix: fallback for 0.9.1

* fix: detect changes only when minor version > 9

(cherry picked from commit 6b79d7a6a4)
This commit is contained in:
JINNOUCHI Yasushi
2023-09-04 07:22:17 +09:00
committed by Simon Hauser
parent 0847120c40
commit 573a8b2b5f
+3
View File
@@ -44,6 +44,9 @@ local diagnostics_to_tbl = function(opts)
diagnosis_opts.severity["max"] = opts.severity_bound
end
end
if vim.version().minor > 9 and vim.tbl_isempty(diagnosis_opts.severity) then
diagnosis_opts.severity = nil
end
opts.root_dir = opts.root_dir == true and vim.loop.cwd() or opts.root_dir