feat: add OilFileIcon highlight group for fallback file icons
Problem: when nvim-web-devicons returns no highlight for an unrecognized file extension, the icon gets nil for its highlight group. Directories have OilDirIcon as a targetable fallback, but files have nothing. Solution: define OilFileIcon (linked to nil, matching OilFile) and use it as the fallback in the devicons provider when get_icon returns a nil highlight. The mini.icons provider already returns highlights for all files so only the devicons path needs this. Resolves: stevearc/oil.nvim#690
This commit is contained in:
parent
85ed9b8a72
commit
ce64ae18de
2 changed files with 6 additions and 0 deletions
|
|
@ -956,6 +956,7 @@ M.get_icon_provider = function()
|
|||
end
|
||||
end
|
||||
local icon, hl = devicons.get_icon(name)
|
||||
hl = hl or "OilFileIcon"
|
||||
icon = icon or (conf and conf.default_file or "")
|
||||
return icon, hl
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue