Skip to content

Commit 5448c2e

Browse files
Changed order surrounding pair lists were combined for spoken scope forms (#2658)
I have a on purpose conflict where I have `string: doubleQuotes` pair and `string: string` scope. This allows me to do `string wrap` that will do double quotes, but `take string` should be all strings not just double quotes. This worked fine before the dfa optimization where we flattened the scope types in #2628 Just rearranging the lists so the one with scope types has higher priority than the list of wrappers fixes this. ## Checklist - [x] 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 eb4d950 commit 5448c2e

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

cursorless-talon/src/spoken_scope_forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ def init_scope_spoken_forms(graphemes_talon_list: dict[str, str]):
1212
def create_flattened_talon_list(ctx: Context, graphemes_talon_list: dict[str, str]):
1313
lists_to_merge = {
1414
"cursorless_scope_type": "simple",
15-
"cursorless_surrounding_pair_scope_type": "surroundingPair",
1615
"cursorless_selectable_only_paired_delimiter": "surroundingPair",
1716
"cursorless_wrapper_selectable_paired_delimiter": "surroundingPair",
17+
"cursorless_surrounding_pair_scope_type": "surroundingPair",
1818
}
1919
# If the user have no custom regex scope type, then that list is missing from the context
2020
if "user.cursorless_custom_regex_scope_type" in ctx.lists.keys(): # noqa: SIM118
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
languageId: typescript
2+
command:
3+
version: 7
4+
spokenForm: change string
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: surroundingPair, delimiter: string}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: "`hello`"
15+
selections:
16+
- anchor: {line: 0, character: 1}
17+
active: {line: 0, character: 1}
18+
marks: {}
19+
finalState:
20+
documentContents: ""
21+
selections:
22+
- anchor: {line: 0, character: 0}
23+
active: {line: 0, character: 0}

0 commit comments

Comments
 (0)