Skip to content

Commit

Permalink
Fix panic in kill_to_end_of_line when handling multibyte characters (
Browse files Browse the repository at this point in the history
  • Loading branch information
tm99hjkl authored Dec 13, 2024
1 parent 617f538 commit e14c346
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions helix-term/src/ui/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
Expand Down

0 comments on commit e14c346

Please sign in to comment.