mirror of
https://github.com/rose-pine/neovim.git
synced 2025-10-15 12:38:53 +02:00
feat: re-add inherit option for custom highlight groups (#198)
This commit is contained in:
parent
b776a47b8b
commit
080c8a1bbf
1 changed files with 10 additions and 0 deletions
|
|
@ -611,6 +611,16 @@ local function set_highlights()
|
||||||
end
|
end
|
||||||
|
|
||||||
for group, options in pairs(config.options.highlight_groups) do
|
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)
|
highlights[group] = vim.tbl_extend("force", highlights[group] or {}, options)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue