Skip to content

Commit 730349d

Browse files
authored
Add iteration scope for markdown items (#2135)
## Checklist - [ ] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [ ] 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) - [ ] I have not broken the cheatsheet
1 parent c6f5600 commit 730349d

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
languageId: markdown
2+
command:
3+
version: 6
4+
spokenForm: change every item
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: everyScope
11+
scopeType: {type: collectionItem}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: |-
15+
ddd eee:
16+
17+
- aaa
18+
- bbb
19+
- ccc
20+
21+
fff ggg:
22+
23+
- hhh
24+
- iii
25+
selections:
26+
- anchor: {line: 4, character: 5}
27+
active: {line: 4, character: 5}
28+
marks: {}
29+
finalState:
30+
documentContents: |-
31+
ddd eee:
32+
33+
-
34+
-
35+
-
36+
37+
fff ggg:
38+
39+
- hhh
40+
- iii
41+
selections:
42+
- anchor: {line: 2, character: 2}
43+
active: {line: 2, character: 2}
44+
- anchor: {line: 3, character: 2}
45+
active: {line: 3, character: 2}
46+
- anchor: {line: 4, character: 2}
47+
active: {line: 4, character: 2}

queries/markdown.scm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,5 @@
3939
(#trim-end! @_.domain)
4040
(#insertion-delimiter! @collectionItem "\n")
4141
)
42+
43+
(list) @collectionItem.iteration

0 commit comments

Comments
 (0)