From a65dba181bdeb7f6a89a43d54fac55fea8d46d07 Mon Sep 17 00:00:00 2001 From: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com> Date: Sun, 12 Jan 2025 08:49:19 +0000 Subject: [PATCH] fix: check for the color pattern against the end --- helix-term/src/ui/completion.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helix-term/src/ui/completion.rs b/helix-term/src/ui/completion.rs index adacfad3..f5b547f0 100644 --- a/helix-term/src/ui/completion.rs +++ b/helix-term/src/ui/completion.rs @@ -92,8 +92,9 @@ impl menu::Item for CompletionItem { value, .. }) => value, }; - Color::from_hex(text) + text.get(text.len() - 7..) }) + .and_then(Color::from_hex) .map_or("color".into(), |color| { Spans::from(vec![ Span::raw("color "),