From 7bca73185f223fe485114f7b153b86e05e2d8f8e Mon Sep 17 00:00:00 2001 From: Micah Halter Date: Sat, 6 Jul 2024 09:09:40 -0400 Subject: [PATCH] fix: correctly check if `mini.icons` is actually setup 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. --- lua/oil/util.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/oil/util.lua b/lua/oil/util.lua index c84c1e97..0de9ddd6 100644 --- a/lua/oil/util.lua +++ b/lua/oil/util.lua @@ -865,7 +865,7 @@ end M.get_icon_provider = function() -- prefer mini.icons local has_mini_icons, mini_icons = pcall(require, "mini.icons") - if has_mini_icons then + if has_mini_icons and _G.MiniIcons then return function(type, name) return mini_icons.get(type == "directory" and "directory" or "file", name) end