Skip to content

Bug: user icons set from setup are lost after refresh #572

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dsaenztagarro opened this issue Apr 6, 2025 · 2 comments · Fixed by #573 or #576
Closed

Bug: user icons set from setup are lost after refresh #572

dsaenztagarro opened this issue Apr 6, 2025 · 2 comments · Fixed by #573 or #576

Comments

@dsaenztagarro
Copy link
Contributor

dsaenztagarro commented Apr 6, 2025

First some words...

Hi, first of all, I appreciate a lot this open source plugin, and really, I'm super happy to have a chance to bring some gratitude for all the work from the NeoVim community. That said! Here is the issue...

Problem

I've realized that this plugin is not applying the icons set by the user by calling to setup function (e.g. icons set from overrides_by_extension.

I've done some investigation, and I have found that in #270 pull request, we introduced this auto command, in order to change icons depending on the background:

-- Change icon set on background change
vim.api.nvim_create_autocmd("OptionSet", {
pattern = "background",
callback = M.refresh,

From the issue description here, I read:

I have no config for nvim-web-devicons.

What it makes me think that the functionality was added without verifying that user overrides were kept.

It happens that NeoVim sets the background on startup automatically, as you can see in :help background

Image

So just after all plugins are loaded with Lazy, the auto command is executed by NeoVim, loosing all user overrides.

As result, user icon overrides are not applied ever.

Requirement

Apply changes needed so user's icons overrides are kept on background changes (i.e. also applied just after opening NeoVim).

P.D: Hope all this makes sense to you 🙏

@alex-courtis
Copy link
Member

Reopened following #575

@dsaenztagarro
Copy link
Contributor Author

@alex-courtis just in case, adding a comment here, ready for you to review! Thanks in advance! 😅

alex-courtis added a commit that referenced this issue Apr 7, 2025
* fix: ensure icon overrides apply after refresh

* Don't apply icons without setup

* org filetype newly added to nvim

---------

Co-authored-by: Alexander Courtis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants