between

fun between(from: DocPos, to: DocPos, f: (from: Int, to: Int, value: T) -> Boolean?)

Iterate over the ranges that touch the region from to to, calling f for each. When the callback returns false, iteration stops.