Skip to content
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

Default icon is not working correctly #449

Closed
sethen opened this issue Apr 22, 2024 · 12 comments
Closed

Default icon is not working correctly #449

sethen opened this issue Apr 22, 2024 · 12 comments

Comments

@sethen
Copy link

sethen commented Apr 22, 2024

I've set a default icon but for whatever reason it's not being picked up by certain files. For instance:

Screenshot from 2024-04-22 19-03-18

However, the setup shows the icon perfectly fine:

Screenshot from 2024-04-22 19-04-14

As you can see the editor renders the page icon just fine but it is not applying it to all icons as a default.

@sethen
Copy link
Author

sethen commented Apr 22, 2024

I solved some of my issue. Part of it was I had to set some things for the file tree explorer itself. However, the default icon isn't working for everything.

@alex-courtis
Copy link
Member

alex-courtis commented Apr 23, 2024

To confirm: does the default default icon show when you remove set_default_icon ?

@sethen
Copy link
Author

sethen commented Apr 24, 2024

To confirm: does the default default icon show when you remove set_default_icon ?

Not sure what you mean... if I delete the set_delete_icon function does the default icon show??

@sethen
Copy link
Author

sethen commented Apr 24, 2024

Here is also another thing I am seeing -- I would assume the default icon would take over here when the TelescopePrompt comes up but it doesn't... However, it does when the help buffer is open. Check the status bar on the bottom right.

No default icon:
Screenshot from 2024-04-24 19-39-35

Default icon:
Screenshot from 2024-04-24 19-42-28

@alex-courtis
Copy link
Member

Experimenting with your setup:

require("nvim-web-devicons").set_default_icon('D', '#6d8086', 65)
print(vim.inspect(require("nvim-web-devicons").get_default_icon()))
{
  color = "#6d8086",
  cterm_color = 65,
  icon = "D",
  name = "Default"
}
require("nvim-web-devicons").set_default_icon('X')
print(vim.inspect(require("nvim-web-devicons").get_default_icon()))
{
  icon = "X",
  name = "Default"
}

That is working as intended, presuming that icon in your screenshot is require("nvim-web-devicons")

@alex-courtis
Copy link
Member

To confirm: does the default default icon show when you remove set_default_icon ?

Not sure what you mean... if I delete the set_delete_icon function does the default icon show??

Yes.

However... that's not to say that nvim-tree, telescope or lualine will actually use it, they may use their own.

Experimenting with nvim-tree and :NvimWebDeviconsHiTest shows that the default icon is not shown or used. Investigating...

alex-courtis added a commit that referenced this issue Apr 28, 2024
…ight group prefix, tag first (#451)

* fix(#449): :NvimWebDeviconsHiTest shows default icon

* fix(#449): :NvimWebDeviconsHiTest shows highlight group prefix "DevIcon", tag first
@alex-courtis
Copy link
Member

alex-courtis commented Apr 28, 2024

:NvimWebDeviconsHiTest not showing the default is unrelated. Fixed at #451

nvim-tree is not showing the default icon, contradicting help:

            *nvim-tree.renderer.icons.web_devicons.file.enable*
            Show icons on files.
            Overrides |nvim-tree.renderer.icons.glyphs.default|
              Type: `boolean`, Default: `true`

        *nvim-tree.renderer.icons.glyphs.default*
        Glyph for files.
        Overridden by |nvim-tree.renderer.icons.web_devicons| if available.
          Type: `string`, Default: `""`

Raised nvim-tree/nvim-tree.lua#2758

@alex-courtis
Copy link
Member

alex-courtis commented Apr 28, 2024

RE lualine: it does not show default icons. I'll leave telescope to you...

Does resolution of this issue resolve your concerns?
nvim-tree/nvim-tree.lua#2758 (comment)

@sethen
Copy link
Author

sethen commented Apr 29, 2024

RE lualine: it does not show default icons. I'll leave telescope to you...

Does resolution of this issue resolve your concerns? nvim-tree/nvim-tree.lua#2758 (comment)

I left a comment over there. Happy to test, just unsure how.

@alex-courtis
Copy link
Member

alex-courtis commented Apr 30, 2024

Fixed via nvim-tree nvim-tree/nvim-tree.lua#2759

@sethen
Copy link
Author

sethen commented May 2, 2024

@alex-courtis Still not seeing the default icon taking effect even after updating nvim-tree.

@alex-courtis
Copy link
Member

@alex-courtis Still not seeing the default icon taking effect even after updating nvim-tree.

That's no good; we'll get to the bottom of this. I reckon it's nvim-tree.

Please raise an nvim-tree bug report with your nvim-tree and nvim-webdevicons minimal configuration so that we may reproduce and fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants