Unnamed repository; edit this file 'description' to name the repository.
Fix panic in `kill_to_end_of_line` when handling multibyte characters (#12237)
| -rw-r--r-- | helix-term/src/ui/prompt.rs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index 1e443ce7..8c7a7baf 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -233,15 +233,7 @@ impl Prompt { position } Movement::StartOfLine => 0, - Movement::EndOfLine => { - let mut cursor = - GraphemeCursor::new(self.line.len().saturating_sub(1), self.line.len(), false); - if let Ok(Some(pos)) = cursor.next_boundary(&self.line, 0) { - pos - } else { - self.cursor - } - } + Movement::EndOfLine => self.line.len(), Movement::None => self.cursor, } } |