Skip to content

Commit ba6b071

Browse files
committed
diagnostic: jump title only show when has mulitple diagnostics
1 parent d2d5990 commit ba6b071

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lua/lspsaga/diagnostic/init.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ end
2929

3030
local function gen_float_title(counts)
3131
local t = {}
32+
local found = 0
3233
for i, v in ipairs(counts) do
3334
if v > 0 then
35+
found = found + 1
3436
local hi = 'Diagnostic' .. vim.diagnostic.severity[i]
3537
t[#t + 1] = { config.ui.button[1], hi }
3638
t[#t + 1] = {
@@ -40,7 +42,7 @@ local function gen_float_title(counts)
4042
t[#t + 1] = { config.ui.button[2], hi }
4143
end
4244
end
43-
return t
45+
return found > 1 and t or nil
4446
end
4547

4648
---get the line or cursor diagnostics

0 commit comments

Comments
 (0)