Skip to content

Git icons for dotfiles have no padding if right aligned #3124

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

Closed
rossw01 opened this issue May 11, 2025 · 0 comments · Fixed by #3125
Closed

Git icons for dotfiles have no padding if right aligned #3124

rossw01 opened this issue May 11, 2025 · 0 comments · Fixed by #3125
Labels
bug Something isn't working

Comments

@rossw01
Copy link
Contributor

rossw01 commented May 11, 2025

Description

If a file starts with a . (dot), all padding will be missing on the git icons if renderer.icons.git_placement is set to "right_align".

The issue has existed since I started using right aligned git icons in November so I don't think it's a regression.

Neovim version

NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1713773202

Operating system and version

Linux 6.12.10-zen1

Windows variant

No response

nvim-tree version

e7d1b7d

Clean room replication

return {
  "nvim-tree/nvim-tree.lua",
  opts = {
    renderer = {
      icons = {
        git_placement = "right_align",
        padding = "  ",
        glyphs = {
          git = {
            unstaged = "",
            staged = "",
            unmerged = "",
            renamed = "",
            untracked = "",
            deleted = "",
            ignored = "",
          },
        },
      },
    }
  }
}

Steps to reproduce

  1. Create a file with a dot in front of the name and one without
  2. run git init
  3. open nvim and look at the git icons in nvim-tree

mkdir foo && cd foo && touch bar .baz && git init && nvim

Expected behavior

The git icons should have their padding preserved:

Image

Image

Actual behavior

The git icons do not have their padding preserved:

Image

Image

@rossw01 rossw01 added the bug Something isn't working label May 11, 2025
rossw01 added a commit to rossw01/nvim-tree.lua that referenced this issue May 11, 2025
rossw01 added a commit to rossw01/nvim-tree.lua that referenced this issue May 11, 2025
alex-courtis pushed a commit that referenced this issue May 18, 2025
…r dotfiles (#3125)

fix(#3124): prevent empty icons_right_align response from breaking padding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant