From f7c44efb6f24a31d5dca3b0c21e75a885442dd29 Mon Sep 17 00:00:00 2001 From: shadmansaleh Date: Tue, 27 Jul 2021 13:18:25 +0600 Subject: [PATCH] Proritize color option then theme when creating comppnent_hl closes #299 --- lua/lualine/highlight.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/lualine/highlight.lua b/lua/lualine/highlight.lua index bcd6a28..22282ec 100644 --- a/lua/lualine/highlight.lua +++ b/lua/lualine/highlight.lua @@ -111,8 +111,10 @@ function M.create_component_highlight_group(color, highlight_tag, options) local default_color_table = active_theme[mode] and active_theme[mode][section] or active_theme.normal[section] - local bg = (color.bg or default_color_table.bg) - local fg = (color.fg or default_color_table.fg) + local bg = (color.bg or (type(options.color) == 'table' and options.color.bg) + or default_color_table.bg) + local fg = (color.fg or (type(options.color) == 'table' and options.color.bg) + or default_color_table.fg) -- Check if it's same as normal mode if it is no need to create aditional highlight if mode ~= 'normal' then if bg ~= normal_hl.bg or fg ~= normal_hl.fg then