Skip to content

Commit

Permalink
feat: added support for mini.icons (closes #1319)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed Jul 21, 2024
1 parent 5ce8ad2 commit 94385e8
Show file tree
Hide file tree
Showing 3 changed files with 262 additions and 153 deletions.
24 changes: 15 additions & 9 deletions lua/fzf-lua/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -537,16 +537,22 @@ function M.normalize_opts(opts, globals, __resume_key)
end


if devicons.plugin_loaded() then
if opts.file_icons then
-- refresh icons, does nothing if "vim.o.bg" didn't change
devicons.load({
icon_padding = opts.file_icon_padding,
dir_icon = { icon = opts.dir_icon, color = utils.hexcol_from_hl(opts.hls.dir_icon, "fg") }
})
elseif opts.file_icons then
-- Disable devicons if not available
utils.warn("nvim-web-devicons isn't available, disabling 'file_icons'.")
opts.file_icons = nil
if not devicons.load({
plugin = opts.file_icons,
icon_padding = opts.file_icon_padding,
dir_icon = {
icon = opts.dir_icon,
color = utils.hexcol_from_hl(opts.hls.dir_icon, "fg")
}
})
then
-- Disable file_icons if requested package isn't available
utils.warn(string.format("error loading '%s', disabling 'file_icons'.",
opts.file_icons == "mini" and "mini.icons" or "nvim-web-devicons"))
opts.file_icons = nil
end
end

-- libuv.spawn_nvim_fzf_cmd() pid callback
Expand Down
Loading

0 comments on commit 94385e8

Please sign in to comment.