nvim-tree / nvim-web-devicons

lua `fork` of vim-web-devicons for neovim
MIT License
1.92k stars 181 forks source link

fix: get_icon_color() is now case insensitive #445

Closed mcauley-penney closed 2 months ago

mcauley-penney commented 2 months ago

Problem: get_icon_color() does not find icons for files whose names are capitalized and which don't have extensions, such as "LICENSE", "License", or "COMMIT_EDITMSG". This is inconsistent with the functionality of get_icon(), which does lowercase the name parameter.

Solution: Lowercase the name parameter in get_icon_color(). Coincidentally, get_icon() and get_icon_color() have a lot of duplicate functionality at the front of the function, specifically to get the entire icon data. Abstract this functionality out to a local function that can be shared by these other two functions, which are now wrapper functions that return different data.