Skip to content

Commit 4fe0d65

Browse files
Change interior scope handler priority to favor surrounding pair interiors (#3068)
Fixes #3067
1 parent b79afc3 commit 4fe0d65

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
languageId: javascript
2+
command:
3+
version: 7
4+
spokenForm: change inside air
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
mark: {type: decoratedSymbol, symbolColor: default, character: a}
10+
modifiers:
11+
- {type: interiorOnly}
12+
usePrePhraseSnapshot: false
13+
initialState:
14+
documentContents: "true ? 'aaa' : 'bbb'"
15+
selections:
16+
- anchor: {line: 0, character: 0}
17+
active: {line: 0, character: 0}
18+
marks:
19+
default.a:
20+
start: {line: 0, character: 8}
21+
end: {line: 0, character: 11}
22+
finalState:
23+
documentContents: "true ? '' : 'bbb'"
24+
selections:
25+
- anchor: {line: 0, character: 8}
26+
active: {line: 0, character: 8}

packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler/InteriorScopeHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export class InteriorScopeHandler extends BaseScopeHandler {
100100
return SortedScopeHandler.createFromScopeHandlers(
101101
this.scopeHandlerFactory,
102102
this.languageId,
103-
[languageScopeHandler, pairScopeHandler],
103+
[pairScopeHandler, languageScopeHandler],
104104
);
105105
}
106106

0 commit comments

Comments
 (0)