diff --git a/lua/frecency/entry_maker.lua b/lua/frecency/entry_maker.lua index c34eb1c..00f13f5 100644 --- a/lua/frecency/entry_maker.lua +++ b/lua/frecency/entry_maker.lua @@ -118,7 +118,8 @@ function EntryMaker:items(entry, workspace, workspace_tag, formatter) end end if self.web_devicons.is_enabled then - table.insert(items, { self.web_devicons:get_icon(entry.name, entry.name:match "%a+$", { default = true }) }) + local basename = utils.path_tail(entry.name) + table.insert(items, { self.web_devicons:get_icon(basename, utils.file_extension(basename), { default = true }) }) 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 diff --git a/lua/frecency/types.lua b/lua/frecency/types.lua index 53eacff..5154100 100644 --- a/lua/frecency/types.lua +++ b/lua/frecency/types.lua @@ -152,6 +152,7 @@ function FrecencyPlenaryAsyncUtil.scheduler() end ---@field path_tail fun(path: string): string ---@field transform_path fun(opts: table, path: string): string, FrecencyTelescopePathStyle[] ---@field buf_is_loaded fun(filename: string): boolean +---@field file_extension fun(filename: string): string ---@class FrecencyTelescopePicker ---@field clear_extra_rows fun(self: FrecencyTelescopePicker, results_bufnr: integer): nil