-
Notifications
You must be signed in to change notification settings - Fork 12
Current node highlight preview functionality #39
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
Awesome - thank you for the ticket. I'm thinking on the best way forward on this now. |
Alright @kuator I have what probably amounts to a half fix: Previously, if you set Treewalker's Now, if you set it similarly high and move around quickly, all previous highlights get removed before applying any new ones. So if you move exclusively with treewalker, this similates highlighting the node that would be swapped. However, if you move onto a node without using treewalker, then the highlight will not be applied. This is why it's probably a half fix. Adding a listener against all movement would add a massive performance cost to movement by just having Treewalker installed, so I don't want to do that. And since treesitter-unit already exists and is great, I don't want to reimplement its functionality. Every new piece of functionality in Treewalker is a new piece of functionality to maintain and fix bugs against. So I think it's good to keep plugins tight and focused, doing only what they originally set out to do. So for now this is going to have to suffice. Unless you have any other ideas! |
Note this is similar to #32 |
Uh oh!
There was an error while loading. Please reload this page.
Currently, without treesitter-unit, it's not possible to determine the syntax node the user is currently located in. This is why installing treesitter-unit becomes necessary. However, this functionality is fundamental and would be a strong candidate for inclusion as a built-in feature.
Here's a demo showcasing a potential implementation of a treewalker with highlight preview enabled:
Peek.2025-05-20.20-56.mp4
The text was updated successfully, but these errors were encountered: