Skip to content

Commit b4c8b62

Browse files
Bugfix
1 parent 1c3f026 commit b4c8b62

File tree

2 files changed

+24
-1
lines changed
  • data/fixtures/recorded/surroundingPair/textual
  • packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler

2 files changed

+24
-1
lines changed
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 pair
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: surroundingPair, delimiter: any}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: "[1, 2, \"]\", 3];"
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}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class RangeIterator<T extends { range: Range }> {
3333
}
3434

3535
// Search item is before the range. Since the ranges are sorted, we can stop here.
36-
if (searchItem.end.isBefore(range.start)) {
36+
if (searchItem.end.isBeforeOrEqual(range.start)) {
3737
return false;
3838
}
3939

0 commit comments

Comments
 (0)