feat: allow overriding unset highlight groups

This commit is contained in:
mvllow 2022-06-16 00:46:30 -04:00
commit 28edf05036

View file

@ -73,13 +73,19 @@ function M.colorscheme()
vim.g.colors_name = 'rose-pine'
local theme = require('rose-pine.theme').get(config)
-- Set theme highlights
for group, color in pairs(theme) do
if config.highlight_groups[group] ~= nil then
util.highlight(group, config.highlight_groups[group])
else
-- Skip highlight group if user overrides
if config.highlight_groups[group] == nil then
util.highlight(group, color)
end
end
-- Set user highlights
for group, color in pairs(config.highlight_groups) do
util.highlight(group, color)
end
end
return M