Skip to content

Commit

Permalink
only apply overrides for current background
Browse files Browse the repository at this point in the history
  • Loading branch information
ramojus committed Jan 20, 2024
1 parent a145aca commit 138ea7b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lua/mellifluous/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,14 @@ function M.prepare()
end

function M.set_highlight_overrides(highlighter, colors)
if M.config.highlight_overrides then
M.config.highlight_overrides(highlighter, colors)
local background = config.is_bg_dark and 'dark' or 'light'

local global_highlight_overrides = vim.tbl_get(M.config, 'highlight_overrides', background) or nil
if global_highlight_overrides then
global_highlight_overrides(highlighter, colors)
end

local color_set_highlight_overrides = vim.tbl_get(M.config, M.config.color_set, 'highlight_overrides') or nil
local color_set_highlight_overrides = vim.tbl_get(M.config, M.config.color_set, 'highlight_overrides', background) or nil
if color_set_highlight_overrides then
color_set_highlight_overrides(highlighter, colors)
end
Expand Down

0 comments on commit 138ea7b

Please sign in to comment.