Skip to content

Commit

Permalink
fix: correctly check if mini.icons is actually setup
Browse files Browse the repository at this point in the history
This leaves the `pcall` just so (1) we load the plugin if it is lazy
loaded by the user and (2) we get LSP completion/validation with that
type as well.
  • Loading branch information
mehalter committed Jul 6, 2024
1 parent a543ea5 commit 6472e30
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/oil/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,8 @@ end
M.get_icon_provider = function()
-- prefer mini.icons
local has_mini_icons, mini_icons = pcall(require, "mini.icons")
if has_mini_icons then
---@diagnostic disable-next-line: undefined-field
if has_mini_icons and _G.MiniIcons then
return function(type, name)
return mini_icons.get(type == "directory" and "directory" or "file", name)
end
Expand Down

0 comments on commit 6472e30

Please sign in to comment.