-
-
Notifications
You must be signed in to change notification settings - Fork 619
after #2415 NonText and WinSeparator have no highlight #2643
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
Comments
I can see the WinSeparator issue; it appears to be similar to #2652 Options:
1,2 would require the namespace highlights to be rebuilt on window create. User changes e.g. |
I've seen the ^^^^ business before when messing with window picker status bar NCs. Changing the entire status line is odd. @JosefLitos I afraid I'm not sure what I'm looking at with the NonText; the |
Ah thank you, I did not see the different colour in the tree window. It looks like all the tree window (namespaced) highlights are misbehaving. #2652 It might be necessary to revert from the new highlight namespace mechanism to the deprecated winhl. |
Minimal reproduction case: vim.opt.termguicolors = true
vim.opt.number = true
vim.opt.relativenumber = true
NS_ID = vim.api.nvim_create_namespace("nvim_tree")
vim.cmd([[
":hi WinSeparator guifg=green
:hi VertSplit guifg=yellow
:hi link NvimTreeLineNrAbove LineNrAbove
:hi link NvimTreeWinSeparator WinSeparator
]])
local function apply_winhl_above()
vim.api.nvim_set_hl(NS_ID, "LineNrAbove", { link = "NvimTreeLineNrAbove" })
vim.api.nvim_win_set_hl_ns(0, NS_ID)
end
local function apply_winhl_sep()
vim.api.nvim_set_hl(NS_ID, "WinSeparator", { link = "NvimTreeWinSeparator" })
vim.api.nvim_win_set_hl_ns(0, NS_ID)
end
vim.keymap.set("n", ";", ":", { noremap = true })
vim.keymap.set("n", "<space>a", apply_winhl_above, { noremap = true })
vim.keymap.set("n", "<space>s", apply_winhl_sep, { noremap = true })
We were using Note:
Unlike the `:highlight` command which can update a highlight group,
this function completely replaces the definition. For example:
`nvim_set_hl(0, 'Visual', {})` will clear the highlight group
'Visual'. What is the behaviour when you have circular link chains? |
Further experimentation with highlights in a namespace has not been successful: Avoiding links (1) works, however does not allow a user to add / remove NvimTree links or definitions. This is a problem as users can and will define highlights after first load. Stale links may not be deleted from the namespace, only cleared. Relinking from the namespace to the global via id (minimal API support and undocumented feature of nvim_set_hl) results in odd behaviour with highlights changing as window focus changes. Further workarounds such as recreating the namespace whenever the window is created are not desirable as namespaces cannot be deleted. Looking at neovim master it seems that the highlighting API is still a work in progress. ⁂ moving back to |
…window (nvim-tree#2653) * fix(nvim-tree#2643): correctly apply linked highlight groups in tree window * fix(nvim-tree#2643): recreate and apply combined highlight groups on colorscheme change
Description
you can also see the weird
^^^^
in my statusline that appear only whenever I enter the NvimTree window (I havelaststatus=3
)Neovim version
Operating system and version
Linux IP5Pro 6.7.0-arch3-1 #1 SMP PREEMPT_DYNAMIC Sat, 13 Jan 2024 14:37:14 +0000 x86_64 GNU/Linux
Windows variant
No response
nvim-tree version
e9c5abe
Clean room replication
Steps to reproduce
open with the provided minimal config (or any config really) and
:NvimTreeOpen
and:vsplit
.Expected behavior
WinSeparator and NonText highlights are consistent across windows
Actual behavior
they are not highlighted at all
The text was updated successfully, but these errors were encountered: