Skip to content

Commit

Permalink
fix: don't try to fetch sign for "other"
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 22, 2021
1 parent 87cae94 commit 5b50990
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lua/trouble/providers/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,16 @@ end
function M.get_signs()
local signs = {}
for _, v in pairs(util.severity) do
-- pcall to catch entirely unbound or cleared out sign hl group
local status, sign = pcall(function()
return vim.trim(vim.fn.sign_getdefined(util.get_severity_label(v, "Sign"))[1].text)
end)
if not status then
sign = v:sub(1, 1)
if v ~= "Other" then
-- pcall to catch entirely unbound or cleared out sign hl group
local status, sign = pcall(function()
return vim.trim(vim.fn.sign_getdefined(util.get_severity_label(v, "Sign"))[1].text)
end)
if not status then
sign = v:sub(1, 1)
end
signs[string.lower(v)] = sign
end
signs[string.lower(v)] = sign
end
return signs
end
Expand Down

0 comments on commit 5b50990

Please sign in to comment.