From e15134beac628a5ee56a5845ca6ebd905c62018c Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 26 Jul 2025 18:14:55 +0200 Subject: [PATCH] prompt: fix crash on unwrap graphemes (#14050) Co-authored-by: Poliorcetics --- helix-term/src/ui/prompt.rs | 3 +-- 1 file changed, 1 insertion(+), 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; -- 2.51.2