Skip to content

Commit 868ff28

Browse files
jmegnerJacob Egnerpokey
authored
document short paint (#1698)
For #839 and #1549. Added a section about "short paint" in main reference page. Improved explanation in cheatsheet. ## Checklist - [ ] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [X] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [X] I have not broken the cheatsheet --------- Co-authored-by: Jacob Egner <[email protected]> Co-authored-by: Pokey Rule <[email protected]>
1 parent 6c1f724 commit 868ff28

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

docs/user/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,26 @@ foo.bar baz|bongo
311311

312312
Saying `"every paint"` would select `foo.bar` and `baz|bongo`.
313313

314+
##### `"short paint"`
315+
316+
The `"short paint"` scope is like `"paint"`, but stops not only at whitespace but also stops if it would exit the nearest [surrounding pair](#surrounding-pair). For example, given the text
317+
318+
```
319+
(aaa[bbb]ccc ddd)
320+
```
321+
322+
- `"take short paint air"` would select `aaa[bbb]ccc`.
323+
- The target starts as `aaa`.
324+
- Trying to expand to the left, we immediately hit a `(`, which is part of a paren pair that surrounds the original `aaa`, so that stops leftward expansion.
325+
- Trying to expand to the right, we hit a `[`, and that pair of square brackets does not surround the original `aaa`, so rightward expansion continues.
326+
- Rightward expansion continues over the `ccc`, then hits a space and stops.
327+
- `"take short paint square"` would select `aaa[bbb]ccc`.
328+
- The target starts as `[`.
329+
- The expansion is not stopped by either the square brackets because they do not surround themselves.
330+
- `"take short paint bat"` would select `bbb`.
331+
- The target starts as `bbb`.
332+
- The expansion is stopped by the square packets that surround `bbb`.
333+
314334
##### `"instance"`
315335

316336
The `"instance"` modifier searches for occurrences of the text of the target. For example:

packages/cheatsheet/src/lib/sampleSpokenFormInfos/defaults.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@
11041104
"variations": [
11051105
{
11061106
"spokenForm": "short paint",
1107-
"description": "Bounded non whitespace sequence"
1107+
"description": "Non whitespace sequence stopped by surrounding pair delimeters"
11081108
}
11091109
]
11101110
},

0 commit comments

Comments
 (0)