-
-
Notifications
You must be signed in to change notification settings - Fork 84
Implemented head tail modifier that works on multiple scope types #708
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
Conversation
Performed git surgery. Original branch at https://github.com/cursorless-dev/cursorless/tree/bak/headTail; feel free to delete if this branch looks ok |
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.
Looks like merge caused test failure; I'll hold off reviewing until you get a chance to take a look
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 not in love with having to modify all the targets for this one. I think it would be pretty clean to have a capture (head | tail) <modifier>?
that can accept any modifier, and then constructs a new modifier that runs its input modifier and then takes the head. I think we could do that without having to touch any files
The problem with that approach is that we want to be able to say things like |
No the trailing modifier is optional, and defaults to "line". So "take head" will still be valid |
Okay that is what you mean with the question mark. I would use square brackets for optionals in talon commands. |
Right sorry yeah couldn't remember the syntax without a talon file in front of me so just fell back to regex 😅 |
No problem I understood that as soon as I grasped your intention :) |
The one thing to think about is what happens if they say something like "head every key". We may want to infer "head line every key"? |
Maybe. Maybe we should leave that one for now and try it out first? |
for more information, see https://pre-commit.ci
@pokey This implementation I think is more to your liking :) |
By the way now we are actually free with the ordering. If we want we could have |
* Implemented head tail modifier that works on multiple scope types * Fixed test that broke in merge * Cleanup * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * More cleanup * More cleanup * More cleanup * Fixed line endings * Updated tests * Updated tests * Head and tail modifiers swallow all following modifiers * Updated tests * Cleanup * Cleanup * Switch head tail stage to use token target instead of plane target * Cleanup head tail stage * Reinstate doc string Co-authored-by: Pokey Rule <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…rsorless-dev#708) * Implemented head tail modifier that works on multiple scope types * Fixed test that broke in merge * Cleanup * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * More cleanup * More cleanup * More cleanup * Fixed line endings * Updated tests * Updated tests * Head and tail modifiers swallow all following modifiers * Updated tests * Cleanup * Cleanup * Switch head tail stage to use token target instead of plane target * Cleanup head tail stage * Reinstate doc string Co-authored-by: Pokey Rule <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
take head funk
clear tail pair
Fixes #623
Checklist