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
This commit is contained in:
JINNOUCHI Yasushi
2023-09-04 07:22:17 +09:00
committed by GitHub
parent 74be3c3bba
commit 6b79d7a6a4

View File

@@ -87,6 +87,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