aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/state.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-core/src/state.rs')
-rw-r--r--helix-core/src/state.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/helix-core/src/state.rs b/helix-core/src/state.rs
index 7eae467d..05380d5e 100644
--- a/helix-core/src/state.rs
+++ b/helix-core/src/state.rs
@@ -142,8 +142,8 @@ fn move_vertically(text: &RopeSlice, dir: Direction, pos: usize, count: usize) -
let (line, col) = coords_at_pos(text, pos);
let new_line = match dir {
- Direction::Backward => line.saturating_sub(n),
- Direction::Forward => std::cmp::min(line.saturating_add(n), text.len_lines() - 1),
+ Direction::Backward => line.saturating_sub(count),
+ Direction::Forward => std::cmp::min(line.saturating_add(count), text.len_lines() - 1),
};
// convert to 0-indexed