Skip to content

Keep cursor at highlighted file/directory when clearing filter #1999

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

Closed
stickperson opened this issue Feb 15, 2023 · 1 comment
Closed

Keep cursor at highlighted file/directory when clearing filter #1999

stickperson opened this issue Feb 15, 2023 · 1 comment

Comments

@stickperson
Copy link

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
@alex-courtis
Copy link
Member

Duplicate of #1785

@alex-courtis alex-courtis marked this as a duplicate of #1785 Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants