From 86fa83761e478e6293eadab60252a0e757136791 Mon Sep 17 00:00:00 2001 From: not Date: Sun, 7 Jan 2024 15:39:30 -0600 Subject: [PATCH] feat: re-add inherit option for custom highlight groups (#198) --- lua/rose-pine.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lua/rose-pine.lua b/lua/rose-pine.lua index d45d4af..aae44bc 100644 --- a/lua/rose-pine.lua +++ b/lua/rose-pine.lua @@ -611,6 +611,16 @@ local function set_highlights() end for group, options in pairs(config.options.highlight_groups) do + local default_opts = highlights[group] or {} + + if (options.inherit == nil or options.inherit) and default_opts ~= nil then -- On merge. + options.inherit = nil -- Don't add this key to the highlight_group after merge. + highlights[group] = vim.tbl_extend("force", default_opts, options) + else -- On overwrite. + options.inherit = nil -- Don't add this key to the highlight_group. + highlights[group] = options + end + highlights[group] = vim.tbl_extend("force", highlights[group] or {}, options) end