diff options
author | Blaž Hrastnik | 2021-05-31 08:08:19 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-05-31 08:08:19 +0000 |
commit | 17e938638807ed9b7ff152b5abbad3fbb1254dbe (patch) | |
tree | 3fcfb8c2673636a1b8d068cf964f982ad5560692 | |
parent | 138787f76e39f208f3a9a757d12b58d86504d1de (diff) |
Allow moving to EOL byte, also fixes #15
-rw-r--r-- | helix-core/src/movement.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/helix-core/src/movement.rs b/helix-core/src/movement.rs index a1de95bd..dd300caa 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) } }; |