Skip to content

Commit 694a050

Browse files
clean up
1 parent e0dbc9f commit 694a050

File tree

1 file changed

+4
-6
lines changed
  • packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers/SurroundingPairScopeHandler

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ export class RangeTreeNode<T extends { range: Range }> {
1313
}
1414

1515
getSmallLestContaining(range: Range): T {
16-
const child = this.children.getContaining(range);
16+
const child = this.children
17+
.getContaining(range)
18+
?.getSmallLestContaining(range);
1719

18-
if (child != null) {
19-
return child.getSmallLestContaining(range);
20-
}
21-
22-
return this.item;
20+
return child ?? this.item;
2321
}
2422
}

0 commit comments

Comments
 (0)