Skip to content

Commit

Permalink
fix: added suport for vim.diagnostic hl groups
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 22, 2021
1 parent 5039b1c commit d25a8e6
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions lua/trouble/colors.lua
@@ -1,15 +1,9 @@
local util = require("trouble.util")

local M = {}

local links = {
Error = "LspDiagnosticsDefaultError",
Warning = "LspDiagnosticsDefaultWarning",
Information = "LspDiagnosticsDefaultInformation",
Hint = "LspDiagnosticsDefaultHint",
SignError = "LspDiagnosticsSignError",
SignWarning = "LspDiagnosticsSignWarning",
SignInformation = "LspDiagnosticsSignInformation",
SignHint = "LspDiagnosticsSignHint",
TextError = "LspTroubleText",
TextError = "TroubleText",
TextWarning = "TroubleText",
TextInformation = "TroubleText",
TextHint = "TroubleText",
Expand All @@ -30,6 +24,11 @@ function M.setup()
for k, v in pairs(links) do
vim.api.nvim_command("hi def link Trouble" .. k .. " " .. v)
end

for _, severity in pairs(util.severity) do
vim.api.nvim_command("hi def link Trouble" .. severity .. " " .. util.get_severity_label(severity))
vim.api.nvim_command("hi def link TroubleSign" .. severity .. " " .. util.get_severity_label(severity, "Sign"))
end
end

return M

0 comments on commit d25a8e6

Please sign in to comment.