-
-
Notifications
You must be signed in to change notification settings - Fork 84
Add support to repeat commands #378
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
Ok so one thought I had was that it may be action-dependant rather than just scope type dependant. For example, if a user implements the Paredit "slurp" command via custom commands (or if we implement it in the future) if they say "slurp air three times", the logical thing is that it slurps the next three forms, but I don't think there's any scope type information that we could use to infer that as the desired behaviour |
That one is a bit harder. But I don't think that the reason it won't work for exactly everything is a good reason to not implemented it? |
Well the problem is that it will shadow that command. It just feels like an indication that we don't yet fully understand this one. We both landed on the notion that it is action-independent, but this counterexample tells me it needs some more thought Here's another example: "pour line three times". According to the logic we have here, that would create a newline after each of the next three lines. But again that isn't what I'd expect. I'd expect three new lines below the current line. |
So I think fundamentally any solution here would need to look at both the action and the targets |
What could make sense is to introduce a few target-action specific implementations, and fall back to basic repeater otherwise |
I have no objections that the implementation needs to be aware of the action. Everything to make it as intuitive and fluent as possible. |
Also worth thinking about how much this stuff overlaps with the "take next two funk" grammar, because I think that grammar is fairly unambiguous so may be preferable in certain situations |
Yes in many cases it does the same thing. |
Tokens and selection are treated on a text level
take air three times
=> Selects the token air and the next two instances of the same textclear this twice
=> Clears the current selection and the next instance of the same texttake first word twice
=> Selects the first sub word and the next instance of the same texttake air past bat twice
=> Selects the range and the next instance of the same textMore complex scope and selection types are treated by order
take line air twice
=> Selects the line containing air and the next line belowtake funk twice
=> Selects the current function and the next one belowTo make this implementation feasible we probably need the new object oriented targets.
In the meantime there is an "ad hoc" solution to try:
https://github.com/AndreasArvidsson/andreas-talon/blob/master/apps/vscode/vscode_take_word.talon
Ponderings:
take air last three times
The text was updated successfully, but these errors were encountered: