Skip to content

Commit

Permalink
fix: only filter msg if sev is hardcoded (#328)
Browse files Browse the repository at this point in the history
Fixes previous breaking change that prevented nvim severity tables from
working, such as:
require("trouble").setup({
	severity = { min = vim.diagnostic.severity.INFO },
})

Optimal fix might be a less naive way of filtering severity, but I'd
leave that for somebody that cares about this feature.

Co-authored-by: Willem Jan Noort <noortw01@heiway.net>
  • Loading branch information
Willem-J-an and Willem Jan Noort committed Aug 30, 2023
1 parent 40aad00 commit 0ccc43d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/trouble/providers/diagnostic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function M.diagnostics(_, buf, cb, options)
end

local messages = {}
if options.severity ~= nil then
if severity[options.severity] then
table.insert(messages, { text = "filter:", group = "Information" })
table.insert(messages, { text = severity[options.severity], group = "Sign" .. util.severity[options.severity] })
end
Expand Down

0 comments on commit 0ccc43d

Please sign in to comment.