Allow moving to EOL byte, also fixes #15
This commit is contained in:
parent
138787f76e
commit
17e9386388
1 changed files with 1 additions and 2 deletions
|
@ -25,8 +25,7 @@ pub fn move_horizontally(
|
||||||
}
|
}
|
||||||
Direction::Forward => {
|
Direction::Forward => {
|
||||||
// Line end is pos at the start of next line - 1
|
// 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(1);
|
||||||
let end = text.line_to_char(line + 1).saturating_sub(2);
|
|
||||||
nth_next_grapheme_boundary(text, pos, count).min(end)
|
nth_next_grapheme_boundary(text, pos, count).min(end)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue