nvim-tree / nvim-web-devicons

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

fix: support ext convention #199

Closed nobuhikosawai closed 1 year ago

nobuhikosawai commented 1 year ago

I saw this https://github.com/nvim-tree/nvim-web-devicons/pull/191 and I like the idea of supporting *.test.js, *.stories.tsx, etc because these are quite common conventions.

The problem is currently this is not working as intended. (Only test.js highlights but not foo.test.js)

image

This PR is to fix this issue. image

Note Whether a plugin can reflect this change depends on the plugin's implementation. (I see some attempt to support option to switch the way to get icons like this PR: https://github.com/akinsho/bufferline.nvim/pull/669)

image

hthuong09 commented 1 year ago

But then again it breaks other types.

For example, I have a file called cat.service.ts, the extension is now service.ts and it does not match any icon.

I would suggest adding another variable to this case and checking it first before the actual extension.

alex-courtis commented 1 year ago

Reported #205

Reverting.