on master help sign in
Allow moving to EOL byte, also fixes #15
17e9386Blaž Hrastnik
helix-core/src/movement.rs+1−2
@@ -25,8 +25,7 @@ pub fn move_horizontally(
25 }
25 }
26 Direction::Forward => {
26 Direction::Forward => {
27 // Line end is pos at the start of next line - 1
27 // Line end is pos at the start of next line - 1
28− // subtract another 1 because the line ends with \n
29− let end = text.line_to_char(line + 1).saturating_sub(2);
28+ let end = text.line_to_char(line + 1).saturating_sub(1);
30 nth_next_grapheme_boundary(text, pos, count).min(end)
29 nth_next_grapheme_boundary(text, pos, count).min(end)
31 }
30 }
32 };
31 };