From a50df1fac6fe04eac1ad5491145ffb8dd2fe22db Mon Sep 17 00:00:00 2001 From: Freddie Haddad <6127369+freddiehaddad@users.noreply.github.com> Date: Tue, 28 Nov 2023 02:00:01 -0800 Subject: [PATCH] fix: merge icon tables preferring user values (#58) --- lua/feline/generator.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/feline/generator.lua b/lua/feline/generator.lua index 8956d21..eeb1bc5 100644 --- a/lua/feline/generator.lua +++ b/lua/feline/generator.lua @@ -463,8 +463,12 @@ local function parse_component(gen, component, use_short_provider, winid, sectio local right_sep_str = parse_sep_list(gen, component.right_sep, hl.bg, is_component_empty) - if component.icon and type(component.icon) ~= 'table' then - icon = component.icon + if component.icon then + if type(component.icon) == 'table' and type(icon) == 'table' then + icon = vim.tbl_deep_extend('keep', component.icon, icon) + else + icon = component.icon + end end icon = parse_icon(gen, icon, hl, is_component_empty)