Skip to content

right_align of renderer's *_placement renders 'after', not right aligned #3267

@gegoune

Description

@gegoune

Description

Seems like 118057e has broken renderer.icons.git_placement = 'right_align' (and other `*_placement's too).

Neovim version

NVIM v0.12.0-dev-4371+g6bc0b8ae87-Homebrew
Build type: Release
LuaJIT 2.1.1770848219

Operating system and version

MacOS 15.7.3

Windows variant

No response

nvim-tree version

1df1960

Clean room replication

for name, url in pairs({
  tree = 'https://github.com/nvim-tree/nvim-tree.lua',
}) do
  local install_path = vim.fn.fnamemodify(string.format('/tmp/nvim_issue/%s', name), ':p')
  if vim.fn.isdirectory(install_path) == 0 then vim.fn.system({ 'git', 'clone', '--depth=1', url, install_path }) end
  vim.opt.runtimepath:append(install_path)
end

print('Minimal Config Ready!')

require('nvim-tree').setup({
  renderer = { icons = { git_placement = 'right_align' } },
})

Steps to reproduce

  1. nvim -nu /tmp/nvt-min.lua
  2. :NvimTreeOpen
  3. navigate to any git repository with 'dirty' files

Expected behavior

Render git status icons on the right hand side edge of nvim-tree window.

Actual behavior

Icons render immediately after filename (with padding) instead.

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