fix component(filetype) to return default icon instead of nothing (#800)

This commit is contained in:
John Fred Fadrigalan 2022-08-20 23:50:53 +08:00 committed by GitHub
parent c0510ddec8
commit 5d8fbf2943
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -35,7 +35,11 @@ function M:apply_icon()
f_extension = f_extension ~= '' and f_extension or vim.bo.filetype
icon, icon_highlight_group = devicons.get_icon(f_name, f_extension)
if icon and self.options.colored then
if icon == nil and icon_highlight_group == nil then
icon = ''
icon_highlight_group='DevIconDefault'
end
if self.options.colored then
local highlight_color = modules.utils.extract_highlight_colors(icon_highlight_group, 'fg')
if highlight_color then
local default_highlight = self:get_default_hl()