From cef01dee8bd07540216c4e4bf429565a86f68d6d Mon Sep 17 00:00:00 2001 From: Rizky Ilham Pratama Date: Fri, 26 Jul 2024 10:38:49 +0800 Subject: [PATCH] fix(icons): improve fallback for multi-part file extensions (#233) --- lua/frecency/entry_maker.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/frecency/entry_maker.lua b/lua/frecency/entry_maker.lua index 00f13f5..3aab98e 100644 --- a/lua/frecency/entry_maker.lua +++ b/lua/frecency/entry_maker.lua @@ -119,7 +119,12 @@ function EntryMaker:items(entry, workspace, workspace_tag, formatter) end if self.web_devicons.is_enabled then local basename = utils.path_tail(entry.name) - table.insert(items, { self.web_devicons:get_icon(basename, utils.file_extension(basename), { default = true }) }) + local icon, icon_highlight = + self.web_devicons:get_icon(basename, utils.file_extension(basename), { default = false }) + if not icon then + icon, icon_highlight = self.web_devicons:get_icon(basename, nil, { default = true }) + end + table.insert(items, { icon, icon_highlight }) end if config.show_filter_column and workspace and workspace_tag then local filtered = self:should_show_tail(workspace_tag) and utils.path_tail(workspace) .. Path.path.sep