From 28edf050363908c672777321b4eb8b9fe77ef512 Mon Sep 17 00:00:00 2001 From: mvllow Date: Thu, 16 Jun 2022 00:46:30 -0400 Subject: [PATCH] feat: allow overriding unset highlight groups --- lua/rose-pine.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lua/rose-pine.lua b/lua/rose-pine.lua index 0fa9c0a..ca82387 100644 --- a/lua/rose-pine.lua +++ b/lua/rose-pine.lua @@ -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