-
Notifications
You must be signed in to change notification settings - Fork 8
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
Text object selections for Top Level Form (aF,iF) #33
Text object selections for Top Level Form (aF,iF) #33
Conversation
Could maybe do with more methods and tests, but this is already working and the tests are passing.
79a54b3
to
a4b224a
Compare
…top level form selections
…le local functions
Okay, code deduplicated and another test for visual selections added. Let me know what you think / what you'd like to change! And feel free to just take this and run with it if you want to make changes of course 😄 I hope this helps! See #12 for more information about this feature. (for future readers / people without context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for taking the time to add this! This is a great improvement with a very clean implementation.
I like the "top level form" terminology too :)
|
||
-- If we call this function on "Sub-node 2" we expect "Branch B" to be | ||
-- returned, the top level one below the document itself. We know which | ||
-- node is the document because it lacks a parent, just like Batman. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🦇
I'm glad you like it! And thanks for building this great plugin, it's a really nice framework to extend. (so thankful that this is lua, I can't bring myself to contribute / work with VimL these days at all 😬 ) |
You're welcome 🤗 It's the least we can do in exchange for Conjure ;)
I know! My aversion to VimL was a large factor in why this project even happened! Haha |
Could maybe do with more methods and tests, but this is already working and the tests are passing. I haven't checked visual selections yet, I presume I will need to add more functions and mappings for that.
The general tree sitter / selection code seems to be working though. I might also refactor this a bit to reuse code between the "current form" and "top level form" functions. There's a lot of overlap there but I thought I'd take the simple copy/paste approach first.
Also I went with "top level" to describe this concept, in my tooling I call it "root" but you already have terms for root and I didn't want to muddy those waters.