nvim-tree / nvim-tree.lua

A file explorer tree for neovim written in lua

Repository from Github https://github.comnvim-tree/nvim-tree.luaRepository from Github https://github.comnvim-tree/nvim-tree.lua

Git icons for dotfiles have no padding if right aligned

rossw01 opened this issue · comments

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