From 032d76ccf2ed4f46c51bf60d190c23edc6b26220 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 53a34c00e..b2378222f 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -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); }