Skip to content

Marks / bookmarks symbol is misaligned if renderer.group_empty = true #2392

@tjex

Description

@tjex

Description

When marking a file, and renderer.group_empty = true the mark symbol gets set one line above where the file actually resides.

Here are screenshots to illustrate (cursor is located at the file which was marked):

./parent/child:
Screenshot 2023-08-29 at 12 44 16

.parent/child/baby (e.g. the depth of folders with no files in them, does not affect mark placement):
Screenshot 2023-08-29 at 12 44 57

./parent/child/baby (with marked file in child):
Screenshot 2023-08-29 at 12 46 50

./parent/child/baby (with marked file in child - renderer.group_empty = false):
Screenshot 2023-08-29 at 13 01 44

here also in minimal config:
Screenshot 2023-08-29 at 13 08 05

Neovim version

NVIM v0.9.1
Build type: Release
LuaJIT 2.1.0-beta3

Operating system and version

MacOS 13.5

nvim-tree version

0074120

Clean room replication

vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvt-min/site]]
local package_root = "/tmp/nvt-min/site/pack"
local install_path = package_root .. "/packer/start/packer.nvim"
local function load_plugins()
    require("packer").startup {
        {
            "wbthomason/packer.nvim",
            "nvim-tree/nvim-tree.lua",
            "nvim-tree/nvim-tree.lua",
            "nvim-tree/nvim-web-devicons",
            -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
        },
        config = {
            package_root = package_root,
            compile_path = install_path .. "/plugin/packer_compiled.lua",
            display = { non_interactive = true },
        },
    }
end
if vim.fn.isdirectory(install_path) == 0 then
    print "Installing nvim-tree and dependencies."
    vim.fn.system { "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path }
end
load_plugins()
require("packer").sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua setup()]]
vim.opt.termguicolors = true
vim.opt.cursorline = true

-- MODIFY NVIM-TREE SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
_G.setup = function()
    require("nvim-tree").setup {
        renderer = {
            group_empty = true
        },
    }
end

Steps to reproduce

  1. replicate folder / file structure from screenshots.
  2. mark a file in a folder with an empty parent with renderer.group_empty = true -> mark is missaligned
  3. same as above but set to false -> mark is alligned

Expected behavior

mark symbols are aligned with the marked file when renderer.group_empty = true some folder above in the directory tree does not contain any files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR pleasenvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciatedbugSomething isn't workingregressionExisting functionality brokenreproducedIssue confirmed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions