nvim-tree / nvim-tree.lua

A file explorer tree for neovim written in lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nvim Tree does not respect custom theme

dimitur2204 opened this issue · comments

Description

Colors seem to be off only on the nvim-tree overlay, changing themes/terminals does not help in that, the issue seems to be from nvim-tree as far as I can tell

Neovim version

NVIM v0.9.4
Build type: Release
LuaJIT 2.1.1696795921

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.9.4/share/nvim"

Run :checkhealth for more info

Operating system and version

macOS 14.3

Windows variant

No response

nvim-tree version

"nvim-tree.lua": { "branch": "master", "commit": "b8c3a23e76f861d5f0ff3f6714b9b56388984d0b" }

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({
		{
			"catppuccin/nvim",
			"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({})
	require("catppuccin").setup({
		flavour = "macchiato",
	})

	vim.cmd.color("catppuccin-macchiato")
end

-- UNCOMMENT this block for diagnostics issues, substituting pattern and cmd as appropriate.
-- Requires diagnostics.enable = true in setup.
--[[
vim.api.nvim_create_autocmd("FileType", {
  pattern = "lua",
  callback = function()
    vim.lsp.start { cmd = { "lua-language-server" } }
  end,
})
]]

Steps to reproduce

  1. nvim -nu nvim-min.lua
  2. :NvimTreeToggle
  3. Check that the color on the tree is different to the other pane

Expected behavior

Should be the same in my opinion. I can't understand why it is not? Is there a reason?

Actual behavior

image image

It appears that catppuccin is setting some specifically different nvim-tree highlights: https://github.com/catppuccin/nvim/blob/main/lua/catppuccin/groups/integrations/nvimtree.lua

nvim-tree will obey those as per :help nvim-tree-highlight

You could Customize catppuccin highlights if they are not to your taste.