Skip to content

Apply opts.renderer.icons.padding to arrow icons #3113

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

Open
smchunn opened this issue Apr 24, 2025 · 3 comments · May be fixed by #3114
Open

Apply opts.renderer.icons.padding to arrow icons #3113

smchunn opened this issue Apr 24, 2025 · 3 comments · May be fixed by #3114
Labels
feature request PR please nvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciated QOL Quality Of Life Improvement

Comments

@smchunn
Copy link

smchunn commented Apr 24, 2025

When using devicons where nerd font is not "mono", the glyphs overhang the next character. Because of this an extra space of padding is added. When using nvim-tree in a floating window with winblend(transparency), the glyphs will overhang the character from the underlying window.

Describe the solution you'd like
add opts.renderer.icons.padding to the padding.get_arrows function

Additional context
using default opts.renderer.icons.padding

Image

using U+00A0 (NO-BREAK SPACE) as opts.renderer.icons.padding

Image
@alex-courtis
Copy link
Member

Thanks for the really useful "transparent diagnostics", the problem is really clear. I can see it in my terminal when I enable arrows.

Yes, let's fix this please. I'd be most grateful for a Pull Request - it looks like you have identified the change necessary.

We will need to define another option, so as not to interrupt renderer.icons.padding users who expect no arrow padding. Does nvim-tree.renderer.icons.folder_arrow_padding sound reasonable to you?

This functionality is historically fragile, so we will need to test all permutations and combinations of renderer options used in padding.lua.

@alex-courtis
Copy link
Member

Once this is all tested and ready to merge, we can refactor the option in a backwards compatible manner. This is messy, so we do it last so as to avoid noise in the PR.

  renderer = {
    icons = {
      padding = {
        icon = " ",
        folder_arrow =  "",
      },
  },

@alex-courtis alex-courtis added PR please nvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciated QOL Quality Of Life Improvement labels Apr 24, 2025
@smchunn smchunn linked a pull request Apr 25, 2025 that will close this issue
@smchunn
Copy link
Author

smchunn commented Apr 25, 2025

I used your naming idea for the new config attribute. I have done minimal testing but will try to test everything tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request PR please nvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciated QOL Quality Of Life Improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants