Skip to content

Highlight hidden feature error #2947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wiserfz opened this issue Oct 8, 2024 · 5 comments · Fixed by #2958
Closed

Highlight hidden feature error #2947

wiserfz opened this issue Oct 8, 2024 · 5 comments · Fixed by #2958
Labels
bug Something isn't working regression Existing functionality broken reproduced Issue confirmed

Comments

@wiserfz
Copy link

wiserfz commented Oct 8, 2024

Description

Highlight hidden config highlight all files and directories.

image

Neovim version

NVIM v0.10.1
Build type: Release
LuaJIT 2.1.1720049189

Operating system and version

macOS 13.2

Windows variant

No response

nvim-tree version

010ae03

Clean room replication

return {
  "nvim-tree/nvim-tree.lua", -- file explorer
  dependencies = {
    "nvim-tree/nvim-web-devicons", -- for file icons
  },
  config = function()
    local setup, tree = pcall(require, "nvim-tree")
    if not setup then
      return
    end

    tree.setup({
      renderer = {
        highlight_hidden = "name",
      },
    })
  end,
}

Steps to reproduce

  1. cargo new foo
  2. nvim foo

Expected behavior

No response

Actual behavior

No response

@wiserfz wiserfz added the bug Something isn't working label Oct 8, 2024
@alex-courtis
Copy link
Member

I'm not able to replicate this one with a minimal configuration. Please report your results with this @Gitfz810

nvt-min.lua

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-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 = {
        highlight_hidden = "name",
      },
    })
end
: ; cargo new foo
    Creating binary (application) `foo` package
note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
: ; nvim -nu nvt-min.lua

20241011_123301

@wiserfz
Copy link
Author

wiserfz commented Oct 14, 2024

I'm not able to replicate this one with a minimal configuration. Please report your results with this @Gitfz810

nvt-min.lua

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-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 = {
        highlight_hidden = "name",
      },
    })
end
: ; cargo new foo
    Creating binary (application) `foo` package
note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
: ; nvim -nu nvt-min.lua

20241011_123301

With this configuration:

image

and the nvim-tree version is:
image

@alex-courtis
Copy link
Member

Replicated this time, from inside foo.

Regression since 5ad8762

@alex-courtis
Copy link
Member

I'd be most grateful if you thoroughly tested a fix branch @Gitfz810

cd /path/to/nvim-tree.lua
git pull
git checkout 2947-all-nodes-highlight-hidden

When you're finished testing:

git checkout master

@wiserfz
Copy link
Author

wiserfz commented Oct 14, 2024

Thank you for your work, I tested with branch 2947-all-nodes-highlight-hidden and the bug has been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression Existing functionality broken reproduced Issue confirmed
Projects
None yet
2 participants