Skip to content
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

Loss of highlighting and colour when selecting windows. #3024

Closed
tttoad opened this issue Dec 9, 2024 · 5 comments
Closed

Loss of highlighting and colour when selecting windows. #3024

tttoad opened this issue Dec 9, 2024 · 5 comments
Labels
awaiting feedback bug Something isn't working

Comments

@tttoad
Copy link

tttoad commented Dec 9, 2024

Description

When I open multiple windows using 'node.open.horizontal', window options A,B,C lose their colours.

Neovim version

NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1720049189

Operating system and version

mac OS 14.5

Windows variant

No response

nvim-tree version

1.8+

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-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({})
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 {
      name = "my-luals",
      cmd = { "lua-language-server" },
      root_dir = vim.loop.cwd(),
    }
  end,
})
]]

Steps to reproduce

I can't reproduce it when I use /tmp/nvt-min.lua.
image

When I disabled the theme, this all worked fine.
Maybe this commit caused it.
f3efc25
Perhaps this should be a feature request?
Is there an option to disable it individually?

Expected behavior

No response

Actual behavior

No response

@tttoad tttoad added the bug Something isn't working label Dec 9, 2024
@alex-courtis
Copy link
Member

Perhaps this should be a feature request?

This looks like a bug.

I'm not able to reproduce using the minimal config, nor with my full config with base 16 theme.

Please attempt a reproduction with the minimal config with your theme. With that, we can reproduce and fix.

@alex-courtis
Copy link
Member

alex-courtis commented Dec 13, 2024

Please see :help nvim-tree-highlight, particularly NvimTreeWindowPicker

Your theme could be overriding that.

:NvimTreeHiTest allows you to see exactly what highlighting is defined.

@tttoad
Copy link
Author

tttoad commented Dec 13, 2024

Perhaps this should be a feature request?

This looks like a bug.

I'm not able to reproduce using the minimal config, nor with my full config with base 16 theme.

Please attempt a reproduction with the minimal config with your theme. With that, we can reproduce and fix.

The theme I use is "navarasu/onedark.nvim".

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",
			"navarasu/onedark.nvim"
		},
		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("onedark").load()
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 {
      name = "my-luals",
      cmd = { "lua-language-server" },
      root_dir = vim.loop.cwd(),
    }
  end,
})
]]

The following colors are cleared when I use v1.9.0. It's working in v1.7.1.

nvim-tree
---------
NvimTreeFolderIcon                                                                        cleared
NvimTreeOpenedFolderIcon        NvimTreeFolderIcon                                        cleared
NvimTreeClosedFolderIcon        NvimTreeFolderIcon                                        cleared
NvimTreeWindowPicker                                                                      cleared

@alex-courtis
Copy link
Member

It looks like the theme is clearing it. Comment out require("onedark").load() and NvimTreeWindowPicker will have a value.

@tttoad
Copy link
Author

tttoad commented Dec 13, 2024

It looks like the theme is clearing it. Comment out require("onedark").load() and NvimTreeWindowPicker will have a value.

I put require(‘onedark’).load() before nvim-tree and it worked fine.
I don't understand why I don't have this problem in nvim-tree(v1.7.0).I can't reproduce it in Clean room replication,
Anyway, thanks for your help. @alex-courtis

@tttoad tttoad closed this as completed Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants