Revert "Preserve selection direction when running editor: open selections in multibuffer
" (#32483)
Reverts zed-industries/zed#31399 I found that in some cases, Zed will panic when using `editor: open selections in multibuffer` if the selection is reversed. It doesn't happen in most cases that I've tested, but in some strange edge cases (that I dont fully understand ATM), it does. I'm reverting for now, as the previous behavior is better than a panic, but will re-implement this fix to preserving selection directions in a new PR with comprehensive testing Release Notes: - N/A
This commit is contained in:
parent
f567bb52ff
commit
5270844b42
1 changed files with 3 additions and 10 deletions
|
@ -18137,16 +18137,9 @@ impl Editor {
|
||||||
.selections
|
.selections
|
||||||
.disjoint_anchors()
|
.disjoint_anchors()
|
||||||
.iter()
|
.iter()
|
||||||
.map(|selection| {
|
.map(|range| Location {
|
||||||
let range = if selection.reversed {
|
buffer: buffer.clone(),
|
||||||
selection.end.text_anchor..selection.start.text_anchor
|
range: range.start.text_anchor..range.end.text_anchor,
|
||||||
} else {
|
|
||||||
selection.start.text_anchor..selection.end.text_anchor
|
|
||||||
};
|
|
||||||
Location {
|
|
||||||
buffer: buffer.clone(),
|
|
||||||
range,
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue