From 99bde075ec3652601346300071e8f0a60282ef7f Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Sat, 30 Jul 2022 09:29:07 -0500 Subject: [PATCH] Use Range::with_direction consistently --- helix-term/src/commands.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 1611ba2fd9c9..5c4411ebccc6 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2159,10 +2159,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); }