mirror of
https://github.com/rose-pine/neovim.git
synced 2025-10-15 12:38:53 +02:00
feat: allow overriding unset highlight groups
This commit is contained in:
parent
b0724442eb
commit
28edf05036
1 changed files with 9 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue