hmm, using editor.selection.ranges is indeed harder than i thought.
selection.ranges contains all the same ranges as rangeList.ranges but sorted with the last added range first.

Maybe keeping exact order isn't needed, but would be good to keep main cursor at the same place.