fix(search): print repo search result in original case

Signed-off-by: Höhl, Lukas <lukas.hoehl@accso.de>
pull/10602/head
Höhl, Lukas 3 years ago
parent c7e1f9b046
commit 488add2cfe

@ -146,11 +146,10 @@ func (i *Index) SearchLiteral(term string, threshold int) []*Result {
term = strings.ToLower(term)
buf := []*Result{}
for k, v := range i.lines {
lk := strings.ToLower(k)
lv := strings.ToLower(v)
res := strings.Index(lv, term)
if score := i.calcScore(res, lv); res != -1 && score < threshold {
parts := strings.Split(lk, verSep) // Remove version, if it is there.
parts := strings.Split(k, verSep) // Remove version, if it is there.
buf = append(buf, &Result{Name: parts[0], Score: score, Chart: i.charts[k]})
}
}

Loading…
Cancel
Save