nvim-tree / nvim-tree.lua

A file explorer tree for neovim written in lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Keep cursor at highlighted file/directory when clearing filter

stickperson opened this issue · comments

Is this a question?
No

Can this functionality be implemented utilising API?
Possibly. api.tree.get_node_under_cursor can get the node but there does not appear to be a method to navigate back to it.

Is your feature request related to a problem? Please describe.
When clearing a filter, it's desirable to keep the node on the current folder/file as opposed to the line.

Describe the solution you'd like
See above

Describe alternatives you've considered
N/A

Additional context
nvim-tree.renderer.draw() is called when clearing the filter. This is where the cursor position is set.

Screen.Recording.2023-02-15.at.7.54.12.AM.mov

Duplicate of #1785