@@ -50,7 +50,7 @@ export class ContiguousScopeHandler extends BaseScopeHandler {
50
50
editor : TextEditor ,
51
51
position : Position ,
52
52
) : Iterable < TargetScope > {
53
- const targetsForward = next (
53
+ let targetsForward = next (
54
54
getTargetsInDirection ( this . scopeHandler , editor , position , "forward" ) ,
55
55
) ;
56
56
@@ -64,6 +64,7 @@ export class ContiguousScopeHandler extends BaseScopeHandler {
64
64
for ( const targets of targetsBackward ) {
65
65
if ( targetsForward != null && isAdjacent ( targets [ 1 ] , targetsForward [ 0 ] ) ) {
66
66
yield targetsToScope ( targets [ 0 ] , targetsForward [ 1 ] ) ;
67
+ targetsForward = undefined ;
67
68
} else {
68
69
yield targetsToScope ( ...targets ) ;
69
70
}
@@ -74,7 +75,7 @@ export class ContiguousScopeHandler extends BaseScopeHandler {
74
75
editor : TextEditor ,
75
76
position : Position ,
76
77
) : Iterable < TargetScope > {
77
- const targetsBackward = next (
78
+ let targetsBackward = next (
78
79
getTargetsInDirection ( this . scopeHandler , editor , position , "backward" ) ,
79
80
) ;
80
81
@@ -91,6 +92,7 @@ export class ContiguousScopeHandler extends BaseScopeHandler {
91
92
isAdjacent ( targetsBackward [ 1 ] , targets [ 0 ] )
92
93
) {
93
94
yield targetsToScope ( targetsBackward [ 0 ] , targets [ 1 ] ) ;
95
+ targetsBackward = undefined ;
94
96
} else {
95
97
yield targetsToScope ( ...targets ) ;
96
98
}
0 commit comments