Fix reverse selections always being cleared (#14150)

When I implemented #13701, I kinda messed up with the reversed
selections, thinking that their anchors are flipped, so I flipped them
again. This caused the reverse selections to always be cleared

Release Notes:

- Fix reverse selections always being cleared, even if the right click
was performed inside
This commit is contained in:
Stanislav Alekseev 2024-07-11 20:35:18 +03:00 committed by GitHub
parent 6eeec9b403
commit fd03454540
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -49,13 +49,11 @@ fn display_ranges<'a>(
.pending
.as_ref()
.map(|pending| &pending.selection);
selections.disjoint.iter().chain(pending).map(move |s| {
if s.reversed {
s.end.to_display_point(&display_map)..s.start.to_display_point(&display_map)
} else {
s.start.to_display_point(&display_map)..s.end.to_display_point(&display_map)
}
})
selections
.disjoint
.iter()
.chain(pending)
.map(move |s| s.start.to_display_point(&display_map)..s.end.to_display_point(&display_map))
}
pub fn deploy_context_menu(