File tree 2 files changed +36
-1
lines changed
cursorless-engine/src/processTargets/modifiers/ItemStage
cursorless-vscode-e2e/src/suite/fixtures/recorded/itemTextual 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,11 @@ export function joinLexemesBySkippingMatchingPairs(lexemes: string[]) {
128
128
}
129
129
130
130
// Starting delimiter found
131
- else if ( leftToRightMap [ lexeme ] != null ) {
131
+ // Make sure that there is a matching closing delimiter
132
+ else if (
133
+ leftToRightMap [ lexeme ] != null &&
134
+ lexemes . indexOf ( leftToRightMap [ lexeme ] , index + 1 ) > - 1
135
+ ) {
132
136
openingDelimiter = lexeme ;
133
137
closingDelimiter = leftToRightMap [ lexeme ] ;
134
138
delimiterBalance = 1 ;
Original file line number Diff line number Diff line change
1
+ languageId : plaintext
2
+ command :
3
+ version : 5
4
+ spokenForm : clear item
5
+ action : {name: clearAndSetSelection}
6
+ targets :
7
+ - type : primitive
8
+ modifiers :
9
+ - type : containingScope
10
+ scopeType : {type: collectionItem}
11
+ usePrePhraseSnapshot : true
12
+ initialState :
13
+ documentContents : |-
14
+ values = [
15
+ 111, // don't ...
16
+ 222,
17
+ 333
18
+ ]
19
+ selections :
20
+ - anchor : {line: 2, character: 4}
21
+ active : {line: 2, character: 4}
22
+ marks : {}
23
+ finalState :
24
+ documentContents : |-
25
+ values = [
26
+ 111, ,
27
+ 333
28
+ ]
29
+ selections :
30
+ - anchor : {line: 1, character: 9}
31
+ active : {line: 1, character: 9}
You can’t perform that action at this time.
0 commit comments