Skip to content

user documentation does not explain "just" target modifier #1537

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

Closed
jmegner opened this issue Jun 17, 2023 · 4 comments · Fixed by #1707
Closed

user documentation does not explain "just" target modifier #1537

jmegner opened this issue Jun 17, 2023 · 4 comments · Fixed by #1707
Labels
documentation Improvements or additions to documentation

Comments

@jmegner
Copy link
Collaborator

jmegner commented Jun 17, 2023

I still don't know what "just" does. The doc mentions it but does not explain it. At first I thought that it shrank a target to exclude the selection-type separator (space for token, \n for line, etc), but I am beginning to think that it does more than that.

The doc mentions "take every instance just air" does something very different than what I described above, so apparently I don't understand the "just" modifier in full generality.

@jmegner
Copy link
Collaborator Author

jmegner commented Jun 17, 2023

I think this issue and #1522 are perhaps more important than they first appear.

Awhile ago, I asked how to do something in cursorless, and the answer involved "before, "start of", and "just". That was the moment where I most felt that I did not understand the underlying structure of cursorless. And now I notice that none of those modifiers are really documented. They are important modifiers that are useful to doing very common editing operations.

@pokey
Copy link
Member

pokey commented Jun 17, 2023

Yeah we should really have more on "just". I believe there's a Cursorless kata about it that's prob the best place to learn about it for now

@auscompgeek auscompgeek added the documentation Improvements or additions to documentation label Jun 17, 2023
@jmegner
Copy link
Collaborator Author

jmegner commented Jun 18, 2023

What is the best way to show a little bit more on the cheatsheet? Edit

"toRawSelection": "No inference",
?

I think there is a big difference in impact between an explanation in the official doc and cheatsheet vs buried in a 3rd party readme. I still haven't looked at more than a handful of katas. I am willing to work on just doc but will probably need correction.

@pokey
Copy link
Member

pokey commented Jun 18, 2023

Essentially the "just" modifier strips the target of any semantic information, treating it as just a dumb range. So eg

  • it won't have any delimiters, and
  • it also will inherit insertion delimiters from its source in the case of a bring. Eg the difference between "bring arg air and bat after just left paren" and "bring arg air and bat after token left paren" will tell Cursorless to use , as the delimiter when joining air and bat instead of using the token delimiters that"token left paren" would have.
  • It's also common to use "just" to break inference chains, because it's a short word that doesn't do too much.
  • In the case of "instance", by default "every instance air" will only consider instances of the air token that are themselves full tokens, but "every instance just air" doesn't have such a restriction, because we've stripped air of its semantic "token-ness".

(copied from #1538 (comment))

github-merge-queue bot pushed a commit that referenced this issue Aug 7, 2023
- Fixes #1537

---------

Co-authored-by: Jacob Egner <[email protected]>
Co-authored-by: Pokey Rule <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants