Is there a way to execute a callback for each selection (in order) when multiple ranges selected?
I.e. the same behavior as in ace editor's
ace.forEachSelection( cb ), which to my knowledge executes the callback for each selection in order, removing (hiding) & restoring the other selections so that when the callback is invoked, the editor state is as if only one range is selected.
The closest API I could find in cm is
replaceSelections, but that one requires an array of strings to be supplied.