Closed mksonkar closed 1 month ago
Do you happen to know whether Neotree supports overriding the cursorline highlight just for its filetype?
If not, it is necessary to leverage Neovim's 'winhighlight'
feature to obtain the desired result, possibly via an autocommand.
I just looked at Neo-tree's code and it seems like the plugin exposes some event handlers for doing what I suggested earlier.
Could you please try adding this to your Neo-tree configuration and report whether the cursorline changes only in its windows?
require("neo-tree").setup({
event_handlers = {
{
event = "neo_tree_buffer_enter",
handler = function()
-- just a silly example to try the event
vim.cmd 'set winhighlight=CursorLine:Normal'
end
}
}
})
Hey, thanks for your response!
I added the mentioned configuration to neo-tree. The highlight color seems to be gone completely, but now there's a black vertical bar just before the file name, on the tree structure of the highlighted file. Also, now that I compare it to the previous screenshot, the background of neo-tree seems to have changed as well.
@raknos13 thanks for reporting back!
I found the time to test it myself, here are my findings:
'cursorline'
being set in your Neovim configuration, because Neo-tree sets the 'cursorline'
option by default inside its windows.'winhighlight'
option:
# :set winhighlight?
winhighlight=Normal:NeoTreeNormal,NormalNC:NeoTreeNormalNC,SignColumn:NeoTreeSignColumn,CursorLine:NeoTreeCursorLine,FloatBorder:NeoTreeFloatBorder,StatusLine:NeoTreeStatusLine,StatusLineNC:NeoTreeStatusLineNC,VertSplit:NeoTreeVertSplit,EndOfBuffer:NeoTreeEndOfBuffer,WinSeparator:NeoTreeWinSeparator
The good news is that the CursorLine
highlight group is already overriden by a highlight group named NeoTreeCursorLine
inside Neo-tree windows. We do not currently have any customization for this highlight group because the default works well in dark mode, but I am going to add a customization for light mode.
Thanks for reporting 👍
Yes, you are correct, dark mode doesn't have this issue, and the highlight is visible clearly.
Thank you for your time and valuable contributions to this wonderful colorscheme!
The highlight color of the cursorline in neo-tree is barely visible. It makes it hard to notice which file is currently highlighted or open. I've searched the documentation, but can't find a way to change the color. Current behaviour: The highlight color of cursorline in neo-tree is barely visible. Expected behaviour: The default highlight color should be a bit darker to make it visible clearly.