@@ -45,7 +45,7 @@ pub fn move_vertically(
4545
4646 let new_line = match dir {
4747 Direction::Backward => row.saturating_sub(count),
48− Direction::Forward => std::cmp::min(row.saturating_add(count), text.len_lines() - 1),
48+ Direction::Forward => std::cmp::min(row.saturating_add(count), text.len_lines() - 2),
4949 };
5050
5151 // convert to 0-indexed, subtract another 1 because len_chars() counts \n