Skip to content

Commit

Permalink
fix: use nil for the default diagnostics severity (#2662)
Browse files Browse the repository at this point in the history
* fix: use nil for the default diagnostics severity

neovim/neovim#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
  • Loading branch information
delphinus authored Sep 3, 2023
1 parent 74be3c3 commit 6b79d7a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/telescope/builtin/__diagnostics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6b79d7a

Please sign in to comment.