-
-
Notifications
You must be signed in to change notification settings - Fork 84
Implement head
and tail
equivalent modifier for other scopes
#623
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
head
and tail
equivalent for modifier for start of/end of filehead
and tail
equivalent for modifier for start of
/end of file
head
and tail
equivalent for modifier for start of
/end of file
head
and tail
equivalent for modifier for start of
/ end of file
head
and tail
equivalent for modifier for start of
/ end of file
head
and tail
equivalent modifier for start of
/ end of file
head
and tail
equivalent modifier for start of
/ end of file
head
and tail
equivalent modifier for other scopes
Sounds great! One question: I wonder what we do about ambiguity, eg "file head" could also be interpreted as "file" <= "head"? |
I'm not sure I understand the ambiguity, would you mind elaborating? |
I would still recommend |
I don't feel strongly between "head file" vs "file head", but I'm not sure I see why one is less ambiguous than the other. "file" and "head" are both modifiers, so no matter which order we put them in there will be ambiguity |
In the version of Cursorless that will be released soon (#672), you'll be able to chain arbitrary modifiers, so eg "every line funk air" will select every line in the function containing "air". Currently, "file" and "head" are both modifiers, so if we introduce a modifier called "file head" that selects the part of file before the mark, then when you say "take file head air", that could be interpreted as first selecting the first part of the line "air", and then selecting the file containing it |
I see the issue now. Thanks for the clarification. I suppose you don't have a way to disambiguate. Something like "file head" always means from the start of the file to the token, because why would anybody include head when they want to refer to the file instead of just using the token? |
Yes I don't see the ambiguity as a particularly big problem. I could see possibly wanting "token head" to mean extend to start of line then expand to containing token (ie if my cursor started in the middle of a token), tho in that case I could say "token line head" to disambiguate, or actually "head token" should work as well The real question is whether talon will prefer to parse "file head" as one modifier rather than splitting it. My guess is yes, but worth checking as we try to implement |
We could also update the pipeline so each stage has access to the previous instance of the target and in that case we could just use |
That's an interesting idea, and actually could be useful for some of the next-gen inference stuff, because for example, trying to parse "every line air between bat" is pretty awkward to do otherwise |
Then I suggest we go that route instead :) |
I find
head
andtail
very useful and I think a similar modifier for other scope types would be useful, especially for "file". We could say eg "file head", "funk head", etcThe text was updated successfully, but these errors were encountered: