Associate StringMatchCandidate with an id

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2022-01-14 14:55:03 +01:00
parent e538beb920
commit be24e58926
5 changed files with 26 additions and 31 deletions

View file

@ -157,7 +157,9 @@ impl ThemeSelector {
let candidates = self
.themes
.list()
.map(|name| StringMatchCandidate {
.enumerate()
.map(|(id, name)| StringMatchCandidate {
id,
char_bag: name.as_str().into(),
string: name,
})
@ -169,7 +171,7 @@ impl ThemeSelector {
.into_iter()
.enumerate()
.map(|(index, candidate)| StringMatch {
candidate_index: index,
candidate_id: index,
string: candidate.string,
positions: Vec::new(),
score: 0.0,