Skip to content

Commit 53351e8

Browse files
Moved tests
1 parent a3fa351 commit 53351e8

File tree

7 files changed

+4
-2
lines changed

7 files changed

+4
-2
lines changed

packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/ContiguousScopeHandler.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class ContiguousScopeHandler extends BaseScopeHandler {
5050
editor: TextEditor,
5151
position: Position,
5252
): Iterable<TargetScope> {
53-
const targetsForward = next(
53+
let targetsForward = next(
5454
getTargetsInDirection(this.scopeHandler, editor, position, "forward"),
5555
);
5656

@@ -64,6 +64,7 @@ export class ContiguousScopeHandler extends BaseScopeHandler {
6464
for (const targets of targetsBackward) {
6565
if (targetsForward != null && isAdjacent(targets[1], targetsForward[0])) {
6666
yield targetsToScope(targets[0], targetsForward[1]);
67+
targetsForward = undefined;
6768
} else {
6869
yield targetsToScope(...targets);
6970
}
@@ -74,7 +75,7 @@ export class ContiguousScopeHandler extends BaseScopeHandler {
7475
editor: TextEditor,
7576
position: Position,
7677
): Iterable<TargetScope> {
77-
const targetsBackward = next(
78+
let targetsBackward = next(
7879
getTargetsInDirection(this.scopeHandler, editor, position, "backward"),
7980
);
8081

@@ -91,6 +92,7 @@ export class ContiguousScopeHandler extends BaseScopeHandler {
9192
isAdjacent(targetsBackward[1], targets[0])
9293
) {
9394
yield targetsToScope(targetsBackward[0], targets[1]);
95+
targetsBackward = undefined;
9496
} else {
9597
yield targetsToScope(...targets);
9698
}

0 commit comments

Comments
 (0)