nvim-tree / nvim-web-devicons

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

fix(#261 #287): persist icon overrides when changing &background #369

Closed ribru17 closed 6 months ago

ribru17 commented 6 months ago

Fixes #261, #287

[!NOTE] This PR does not address the problem of overrides being unaware of light/dark modes. They are applied universally still. This functionality will have to be implemented later, but this PR is better than nothing.

Bekaboo commented 6 months ago

This PR does not address the problem of overrides being unaware of light/dark modes. They are applied universally still. This functionality will have to be implemented later, but this PR is better than nothing.

It will be great if we can just keep the current config structure and auto-generate the dark version (used with light bg) of the icons provided by users using the same logic that generates the dark icons for the default ones. I would like to help with this when I have time.

ribru17 commented 6 months ago

I think ideally this should be done in another PR, I think getting this one merged on it's own will be good enough for many cases. From there I could try to make a PR for what you are saying. I could be wrong but it looks like the light mode icons are generated from the dark mode ones, given the darkening function in the scripts. Maybe we can just expose it publicly (it is private right now) and then use it directly in the refreshing function, detecting when the background is light?

Bekaboo commented 6 months ago

Yeah I mean I can make another PR for the problem of overrides being unaware of light/dark modes. Haven't gotten time to really look into this though, it will be cool if you are willing to do it!

ribru17 commented 6 months ago

I think this PR is good to merge. I have a change waiting that will also update the highlights properly, but only for hex colors, not cterm. I'm not sure how to handle that one.