Preserve selection direction when running an editor: open selections in multibuffer (#31399)

Release Notes:

- Preserve selection direction when running an `editor: open selections
in multibuffer`
This commit is contained in:
Joseph T. Lyons 2025-05-25 18:52:40 -04:00 committed by GitHub
parent 1b3f20bdf4
commit 3d0147aafc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17509,9 +17509,16 @@ impl Editor {
.selections
.disjoint_anchors()
.iter()
.map(|range| Location {
buffer: buffer.clone(),
range: range.start.text_anchor..range.end.text_anchor,
.map(|selection| {
let range = if selection.reversed {
selection.end.text_anchor..selection.start.text_anchor
} else {
selection.start.text_anchor..selection.end.text_anchor
};
Location {
buffer: buffer.clone(),
range,
}
})
.collect::<Vec<_>>();