mirror of
https://github.com/helix-editor/helix.git
synced 2025-01-19 13:37:06 +04:00
parent
22dad592b8
commit
c0264b9f7f
@ -45,7 +45,7 @@ pub fn move_vertically(
|
|||||||
|
|
||||||
let new_line = match dir {
|
let new_line = match dir {
|
||||||
Direction::Backward => row.saturating_sub(count),
|
Direction::Backward => row.saturating_sub(count),
|
||||||
Direction::Forward => std::cmp::min(row.saturating_add(count), text.len_lines() - 1),
|
Direction::Forward => std::cmp::min(row.saturating_add(count), text.len_lines() - 2),
|
||||||
};
|
};
|
||||||
|
|
||||||
// convert to 0-indexed, subtract another 1 because len_chars() counts \n
|
// convert to 0-indexed, subtract another 1 because len_chars() counts \n
|
||||||
|
Loading…
Reference in New Issue
Block a user