Skip to content

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

Closed
@rossw01

Description

@rossw01

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions