fix(#2758): use nvim-webdevicons default file icon, not renderer.icons.glyphs.default, as per :help (#2759)

fix(#2758): use nvim-webdevicons default for default files
This commit is contained in:
Alexander Courtis 2024-04-30 11:32:51 +10:00 committed by GitHub
parent 76db7ed0da
commit 347e1eb352
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -64,10 +64,15 @@ local function get_file_icon_webdev(fname, extension)
elseif string.match(extension, "%.(.*)") then
-- If there are more extensions to the file, try to grab the icon for them recursively
return get_file_icon_webdev(fname, string.match(extension, "%.(.*)"))
else
local devicons_default = M.devicons.get_default_icon()
if devicons_default and type(devicons_default.icon) == "string" and type(devicons_default.name) == "string" then
return devicons_default.icon, "DevIcon" .. devicons_default.name
else
return get_file_icon_default()
end
end
end
local function config_file_icon()
if M.config.show.file then