fix: only validate severity table when using a range (#2709)
The only possibility for having a table with different severities to pass to `vim.diagnostics.get()` as opts is when setting a range (limit and bound), so just check for an empty table when a range is set.
This commit is contained in:
committed by
GitHub
parent
e7cfbb5d1f
commit
40c8d2fc2b
@@ -86,9 +86,9 @@ local diagnostics_to_tbl = function(opts)
|
|||||||
if opts.severity_bound ~= nil then
|
if opts.severity_bound ~= nil then
|
||||||
diagnosis_opts.severity["max"] = opts.severity_bound
|
diagnosis_opts.severity["max"] = opts.severity_bound
|
||||||
end
|
end
|
||||||
end
|
if vim.version().minor > 9 and vim.tbl_isempty(diagnosis_opts.severity) then
|
||||||
if vim.version().minor > 9 and vim.tbl_isempty(diagnosis_opts.severity) then
|
diagnosis_opts.severity = nil
|
||||||
diagnosis_opts.severity = nil
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.root_dir = opts.root_dir == true and vim.loop.cwd() or opts.root_dir
|
opts.root_dir = opts.root_dir == true and vim.loop.cwd() or opts.root_dir
|
||||||
|
|||||||
Reference in New Issue
Block a user