Report the candidate's index when matching strings

This commit is contained in:
Antonio Scandurra 2022-01-13 15:09:27 +01:00
parent 5f2ac61401
commit 5e64f1aca8
2 changed files with 17 additions and 8 deletions

View file

@ -167,7 +167,9 @@ impl ThemeSelector {
self.matches = if query.is_empty() {
candidates
.into_iter()
.map(|candidate| StringMatch {
.enumerate()
.map(|(index, candidate)| StringMatch {
candidate_index: index,
string: candidate.string,
positions: Vec::new(),
score: 0.0,