nvim-tree/nvim-tree.lua

Apply opts.renderer.icons.padding to arrow icons

Closed this issue · 3 comments

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

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.

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 =  "",
      },
  },

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