nvim-tree / nvim-tree.lua

A file explorer tree for neovim written in lua
Other
7.17k stars 611 forks source link

Separate active buffer highlight from vim.opt.cursorline #2013

Open JoseConseco opened 1 year ago

JoseConseco commented 1 year ago

Can this functionality be implemented utilising API? I do not think so

Is your feature request related to a problem? Please describe. If I have disabled vim.opt.cursorline then NvimTree wont highlight active buffer.

Describe the solution you'd like Custom highlight - not dependent on nvim, but it would only depends on NvimTree config

Describe alternatives you've considered We can make hack with autocmd that enables cursorline for NvimTree, but is not 'fun'.

gegoune commented 1 year ago

Proposal: new highlight group NvimTreeFileCurrent or Focused. Will require refreshing tree on events such as BufEnter or BufWinEnter. @alex-courtis can you see any downsides?

It does seem like very reasonable request, cursor line highlighting should be used more for cursor movement(navigation) rather than displaying state.

alex-courtis commented 1 year ago

This is a great idea, adds consistency. Currently there is no way to do this except for update_focused_file

This can be done without a refresh, a draw should be good enough as per opened files.

gegoune commented 1 year ago

Of course, meant redraw, not a refresh, just to update highlight group.

alex-courtis commented 1 month ago

This can be a lua/nvim-tree/renderer/decorator