Skip to content

Commit

Permalink
fix #75
Browse files Browse the repository at this point in the history
  • Loading branch information
zztrieuzz committed Jun 17, 2024
1 parent 20f5b25 commit 47b53bb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lua/windline/components/basic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,12 @@ M.file_icon = function(opt)
if not opt.hl_colors then
return hl ~= 'DevIconDefault' and icon or opt.default
end
if file_ext == "" then file_ext = nil end
local highlight = string.format('WL%s_%s',opt.hl_colors[1], opt.hl_colors[2])
if hl == 'DevIconDefault' then
if hl == 'DevIconDefault' or not file_ext then
return { opt.default, highlight }
end
if hl then
highlight = string.format('WL%s_%s', file_ext, opt.hl_colors[2])
highlight = string.format('WL%s_%s', vim.bo[bufnr].filetype or file_ext, opt.hl_colors[2])
local fg = themes.get_hl_color(hl)
local bg = utils.get_color(WindLine.state.colors, opt.hl_colors[2])
utils.highlight(highlight, { fg = fg, bg = bg })
Expand Down

0 comments on commit 47b53bb

Please sign in to comment.