fix: check for the color pattern against the end

This commit is contained in:
Nikita Revenco 2025-01-12 08:49:19 +00:00
parent 6c9619d094
commit a65dba181b

View file

@ -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 "),