searchByRange

fun Node.searchByRange(range: Range, selfContained: Boolean = false): Sequence<Node>

Return

all nodes containing the given range using depth-first search. Empty list if none are found.

Parameters

range

the range where to search for nodes

selfContained

whether the starting node range contains the ranges of all its children. If true: no further search will be performed in subtrees where the root node falls outside the given range. If false (default): the search will cover all nodes from the starting node to the leaves. In any case, the search stops at the first subtree found to be containing the range.