Skip to content

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

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
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

smchunn
Copy link

@smchunn smchunn commented Apr 25, 2025

resolves #3113

default: opts.renderer.icons.folder_arrow_padding = " "

@alex-courtis
Copy link
Member

You legend @smchunn

I'll get to a review and test over the weekend.

@alex-courtis
Copy link
Member

@alex-courtis alex-courtis changed the title Add configurable padding to folder icons feat(#3113): add renderer.icons.folder_arrow_padding Apr 26, 2025
Copy link
Member

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working nicely.

Full test matrix for config items that affect padding:

renderer.indent_width

renderer.icons.padding
renderer.icons.folder_arrow_padding

renderer.icons.show.folder_arrow

renderer.indent_markers.enable
renderer.indent_markers.inline_arrows
renderer.indent_markers.icons ...

That's not practical. Testing just those that affect get_arrows.
Directory and not directory.
Uncomment each test as you go

renderer.icons.glyphs.folder.arrow_closed = ">"
renderer.icons.glyphs.folder.arrow_open = "|"
renderer.icons.glyphs.folder.default = "c"
renderer.icons.glyphs.folder.open = "o"

-- renderer.icons.show.folder_arrow = false

-- renderer.icons.show.folder_arrow = true
-- renderer.indent_markers.enable = false
-- renderer.icons.folder_arrow_padding = "-"

-- renderer.icons.show.folder_arrow = true
-- renderer.indent_markers.enable = false
-- renderer.icons.folder_arrow_padding = ""

-- renderer.icons.show.folder_arrow = true
-- renderer.indent_markers.enable = true
-- renderer.icons.folder_arrow_padding = "-"

-- renderer.icons.show.folder_arrow = true
-- renderer.indent_markers.enable = false
-- renderer.icons.folder_arrow_padding = "----"

-- renderer.icons.show.folder_arrow = true
-- renderer.indent_markers.enable = true
-- renderer.icons.folder_arrow_padding = "----"

-- renderer.icons.glyphs.folder.arrow_closed = ""
-- renderer.icons.show.folder_arrow = true
-- renderer.indent_markers.enable = true
-- renderer.icons.folder_arrow_padding = "-"

-- renderer.icons.glyphs.folder.arrow_open = ""
-- renderer.icons.show.folder_arrow = true
-- renderer.indent_markers.enable = true
-- renderer.icons.folder_arrow_padding = "-"

@alex-courtis
Copy link
Member

This is looking really good.

Let's refactor the options now:

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

We do this via legacy.lua and document it in :help nvim-tree-legacy-opts.

renderer.icons.webdev_colors looks like a good one to emulate - it moves a higher level option into a new subtable.

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

Successfully merging this pull request may close these issues.

Apply opts.renderer.icons.padding to arrow icons
2 participants