Use Range::with_direction consistently

This commit is contained in:
Michael Davis 2022-07-30 09:29:07 -05:00 committed by Blaž Hrastnik
parent 274f2ea459
commit 032d76ccf2

View file

@ -2177,10 +2177,7 @@ fn ensure_selections_forward(cx: &mut Context) {
let selection = doc
.selection(view.id)
.clone()
.transform(|r| match r.direction() {
Direction::Forward => r,
Direction::Backward => r.flip(),
});
.transform(|r| r.with_direction(Direction::Forward));
doc.set_selection(view.id, selection);
}