@@ -34,10 +34,9 @@ pub fn move_horizontally(
3434 let pos = range.cursor(slice);
3535
3636 // Compute the new position.
37− let new_pos = if dir == Direction::Backward {
38− nth_prev_grapheme_boundary(slice, pos, count)
39− } else {
40− nth_next_grapheme_boundary(slice, pos, count)
37+ let new_pos = match dir {
38+ Direction::Forward => nth_next_grapheme_boundary(slice, pos, count),
39+ Direction::Backward => nth_prev_grapheme_boundary(slice, pos, count),
4140 };
4241
4342 // Compute the final new range.
@@ -59,10 +58,9 @@ pub fn move_vertically(
5958
6059 // Compute the new position.
6160 let (new_pos, new_row) = {
62− let new_row = if dir == Direction::Backward {
63− row.saturating_sub(count)
64− } else {
65− (row + count).min(slice.len_lines().saturating_sub(1))
61+ let new_row = match dir {
62+ Direction::Forward => (row + count).min(slice.len_lines().saturating_sub(1)),
63+ Direction::Backward => row.saturating_sub(count),
6664 };
6765 let new_col = col.max(horiz as usize);
6866 (