From 6b79d7a6a45adc1508a7afee5bc973173ec22f59 Mon Sep 17 00:00:00 2001 From: JINNOUCHI Yasushi Date: Mon, 4 Sep 2023 07:22:17 +0900 Subject: [PATCH] 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 --- lua/telescope/builtin/__diagnostics.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/telescope/builtin/__diagnostics.lua b/lua/telescope/builtin/__diagnostics.lua index fcaa10f..10ea463 100644 --- a/lua/telescope/builtin/__diagnostics.lua +++ b/lua/telescope/builtin/__diagnostics.lua @@ -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