Skip to content

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

Closed
@smchunn

Description

@smchunn
Contributor

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

Activity

alex-courtis

alex-courtis commented on Apr 24, 2025

@alex-courtis
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

alex-courtis commented on Apr 24, 2025

@alex-courtis
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 =  "",
      },
  },
added
PR pleasenvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciated
QOLQuality Of Life Improvement
on Apr 24, 2025
smchunn

smchunn commented on Apr 25, 2025

@smchunn
ContributorAuthor

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

added a commit that references this issue on May 5, 2025

feat(#3113): add renderer.icons.folder_arrow_padding (#3114)

ea5097a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR pleasenvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciatedQOLQuality Of Life Improvementfeature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @alex-courtis@smchunn

      Issue actions

        Apply opts.renderer.icons.padding to arrow icons · Issue #3113 · nvim-tree/nvim-tree.lua