Skip to content

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

Closed
@rossw01

Description

@rossw01
Contributor

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

Activity

added 2 commits that reference this issue on May 11, 2025

fix(nvim-tree#3124): prevent empty icons_after response from breaking…

fix(nvim-tree#3124): prevent empty icons_right_align response from br…

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

fix(#3124): fix icon padding for "right_align" placements, notably fo…

e4cd856
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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @rossw01

      Issue actions

        Git icons for dotfiles have no padding if right aligned · Issue #3124 · nvim-tree/nvim-tree.lua