Make `Buffer::edit` and `MultiBuffer::edit` resilient to inverted ranges

Previously, we would accept edits containing out-of-order ranges. When
generating such ranges in our randomized tests, many invariants started
breaking causing e.g. undo/redo to misbehave and operation application
to panic.

In theory, we should never pass inverted ranges, but this commit changes
the above functions to swap the start and the end when that occurs to avoid
breaking the entire system and panicking.
8826ad5dddAntonio Scandurra committed on 6/6/2022, 1:22:36 PMparent939020a
3 files changedLine totals unavailable