Allow moving to EOL byte, also fixes #15
commit17e938638807ed9b7ff152b5abbad3fbb1254dbe
authorBlaž Hrastnik <blaz@mxxn.io>
dateMon 31 May 2021, 17:08 (5 years ago)
parent138787f
helix-core/src/movement.rs+1−2
@@ -25,8 +25,7 @@ pub fn move_horizontally(
2525 }
2626 Direction::Forward => {
2727 // 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);
3029 nth_next_grapheme_boundary(text, pos, count).min(end)
3130 }
3231 };