editor: Fix SelectionsCollection::disjoint not being ordered correctly
#40249
+20
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We've been seeing the occasional
cannot seek backwardspanic withinSelectionsCollectionwithout means to reproduce.I believe the cause is one of the callers of
MutableSelectionsCollection::selectnot passing a well formedSelectionwherestart > end, so this PR enforces the invariant inselectby swapping the fields and settingreversedas required as the other mutator functions already do that as well.We could also just assert this instead, but it callers usually won't care about this so its the less user facing annoyance to just fix this invariant up internally.
Fixes ZED-253
Fixes ZED-ZJ
Fixes ZED-23S
Fixes ZED-222
Fixes ZED-1ZV
Fixes ZED-1SN
Fixes ZED-1Z0
Fixes ZED-10E
Fixes ZED-1X0
Fixes ZED-12M
Fixes ZED-1GR
Fixes ZED-1VE
Fixes ZED-13X
Fixes ZED-1G4
Release Notes: