Merge remote-tracking branch 'color-completion/colored-color-completions-fix'
This commit is contained in:
commit
c444af66fb
1 changed files with 3 additions and 1 deletions
|
@ -92,7 +92,9 @@ impl menu::Item for CompletionItem {
|
|||
value, ..
|
||||
}) => value,
|
||||
};
|
||||
text.get(text.len() - 7..)
|
||||
// Language servers which send Color completion items tend to include a 6
|
||||
// digit hex code at the end for the color. The extra 1 digit is for the '#'
|
||||
text.get(text.len().checked_sub(7)?..)
|
||||
})
|
||||
.and_then(Color::from_hex)
|
||||
.map_or("color".into(), |color| {
|
||||
|
|
Loading…
Reference in a new issue