nvim-tree / nvim-web-devicons

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

Package-lock.json file name causes error #363

Closed sethen closed 9 months ago

sethen commented 9 months ago

Using something like this in overrides causes an error in Neovim

["package-lock.json"] = {
   icon = "",
   name = "Package-lock.json"
}

I get this whenever I open an directory with a package-lock.json file in it in nvim-tree. Funny enough the icon works though.

Untitled

Akmadan23 commented 9 months ago

The - character is not allowed in group names, having that in the name field causes the error.

sethen commented 9 months ago

Is there any way for me to change the icon of this file then by targeting that file name?

Akmadan23 commented 9 months ago

There's nothing wrong with the file name itself (the ["package-lock.json"] = part), the issue is with the name field, which only affects the highlight group, so it can be different (by default it's "PackageLockJson").