diff --git a/helix-core/src/movement.rs b/helix-core/src/movement.rs index a1de95bd0..dd300caa0 100644 --- a/helix-core/src/movement.rs +++ b/helix-core/src/movement.rs @@ -25,8 +25,7 @@ pub fn move_horizontally( } Direction::Forward => { // Line end is pos at the start of next line - 1 - // subtract another 1 because the line ends with \n - let end = text.line_to_char(line + 1).saturating_sub(2); + let end = text.line_to_char(line + 1).saturating_sub(1); nth_next_grapheme_boundary(text, pos, count).min(end) } };