Unnamed repository; edit this file 'description' to name the repository.
prompt: fix crash on unwrap graphemes (#14050)
Co-authored-by: Poliorcetics <[email protected]>
Alexander 7 months ago
parent 22e60d6 · commit e15134b
-rw-r--r--helix-term/src/ui/prompt.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs
index ff4ca1fc..d2448335 100644
--- a/helix-term/src/ui/prompt.rs
+++ b/helix-term/src/ui/prompt.rs
@@ -779,8 +779,7 @@ impl Component for Prompt {
col += self.line[self.cursor..]
.graphemes(true)
.next()
- .unwrap()
- .width();
+ .map_or(0, |g| g.width());
}
let line = area.height as usize - 1;