feat: support for multi-part file extensions (#215)

* feat: support for multi-part file extensions

* chore: fix for linting

---------

Co-authored-by: JINNOUCHI Yasushi <delphinus35+github@me.com>
This commit is contained in:
Rizky Ilham Pratama 2024-06-21 17:02:20 +08:00 committed by GitHub
parent 78570e237c
commit f3f9325379
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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