From 5d8fbf2943654043cd6ec79568bd51a245c8fd93 Mon Sep 17 00:00:00 2001 From: John Fred Fadrigalan Date: Sat, 20 Aug 2022 23:50:53 +0800 Subject: [PATCH] fix component(filetype) to return default icon instead of nothing (#800) --- lua/lualine/components/filetype.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/lualine/components/filetype.lua b/lua/lualine/components/filetype.lua index ff3963a..cb101de 100644 --- a/lua/lualine/components/filetype.lua +++ b/lua/lualine/components/filetype.lua @@ -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()