I’m interested in how the RangeSet data structure works. Is my understanding correct that overlapping ranges are never stored within the same list of chunks? Instead when a new range is inserted that would overlap an existing ranges it gets pushed to the “nextLayer” until no ranges overlap in that next layer?
If that’s how it works is this something unique that you came up with for CodeMirror, or is it a more general approach that other text editors use? I hadn’t seen it before. Anyway seems to nicely solve the problems of querying overlapping ranges efficiently as long as you don’t expect too many overlaps.