Skip to content

Commit a84b635

Browse files
jmegnerJacob Egnerpokey
authored
add "just" section to reference page (#1707)
- Fixes #1537 --------- Co-authored-by: Jacob Egner <[email protected]> Co-authored-by: Pokey Rule <[email protected]>
1 parent 1e5e0f0 commit a84b635

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/user/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,33 @@ If your cursor is touching a token, you can say `"take every instance"` to selec
351351

352352
Pro tip: if you say eg `"take five instances air"`, and it turns out you need more, you can say eg `"take that and next two instances that"` to select the next two instances after the last instance you selected.
353353

354+
##### `"just"`
355+
356+
The `"just"` modifier strips the target of any semantic information, treating it as just a raw range, with the following effects:
357+
358+
- The new target has no leading or trailing delimiters. For example:
359+
360+
- `"chuck just air"` will delete just the air token, leaving adjacent spaces undisturbed, unlike the default behaviour of `"chuck air"` that deletes the air token _and_ cleans up adjacent whitespace as appropriate. Ie for
361+
362+
```
363+
bbb aaa ccc
364+
```
365+
366+
`"chuck just air"` would result in `bbb ccc` (note the double space in the middle), whereas `"chuck air"` would result in `bbb ccc`.
367+
368+
- `"chuck just line"` will delete only the content of the current line, without removing the line ending, resulting in a blank line, unlike the default behaviour of `"chuck line"` that removes the line entirely, leaving no blank line.
369+
370+
- A raw range does not have its own insertion delimitiers.
371+
- For example, `"paste after just air"` will paste directly after the air token, without inserting a space, as opposed to the way `"paste after air"` would insert a space before the pasted content.
372+
- If you use `"just"` on the destination of a `"bring"` command, it will inherit its insertion delimiters from the source of the `"bring"` action. For example, in the command `"bring arg air and bat after just paren"`, the `"air"` and `"bat"` arguments will be joined by commas. In contrast, `"bring arg air and bat after token paren"` would join the arguments with spaces.
373+
- In the case of [`"instance"`](#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".
374+
375+
Some examples:
376+
377+
- `"chuck just air"`: deletes just the air token, leaving spaces undisturbed.
378+
- `"chuck just line"`: deletes just the content of the line, leaving a blank line.
379+
- `"bring bat after just air"`: results in something like `aaabbb` where the bat token was copied after the air token with no delimeter between them.
380+
354381
###### Experimental: `"from"`
355382
356383
We have experimental support for prefixing a command with `"from <target>"` to narrow the range within which `"every instance"` searches, or to set the start point from which `"next instance"` searches. For example:

0 commit comments

Comments
 (0)