Skip to content

Commit

Permalink
Changes search to ignore case
Browse files Browse the repository at this point in the history
  • Loading branch information
leucos committed Oct 28, 2020
1 parent 318e201 commit 4ce1eb9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,13 @@ func New(o ...func(*App) error) (*App, error) {
// in name or description
func (a *App) Search(pfix string) []string {
res := []string{}
pfix = strings.ToLower(pfix)
// First add matching distributions
for k, v := range a.def.Sources {
if strings.Contains(k, pfix) {
if strings.Contains(strings.ToLower(k), pfix) {
res = append(res, k)
}
if strings.Contains(v.Description, pfix) {
if strings.Contains(strings.ToLower(v.Description), pfix) {
res = append(res, k)
}
}
Expand Down

0 comments on commit 4ce1eb9

Please sign in to comment.