Remove RankFind

Doesn't work correctly with next and previous actions
This commit is contained in:
erroneousboat 2017-12-17 14:04:15 +01:00
parent 4234a63d7d
commit d66673d4b6

View File

@ -1,8 +1,6 @@
package components
import (
"sort"
"github.com/erroneousboat/termui"
"github.com/renstrom/fuzzysearch/fuzzy"
)
@ -202,12 +200,11 @@ func (c *Channels) ScrollDown() {
func (c *Channels) Search(term string) {
c.SearchMatches = make([]int, 0)
matches := fuzzy.RankFind(term, c.List.Items)
sort.Sort(matches)
matches := fuzzy.Find(term, c.List.Items)
for _, m := range matches {
for i, item := range c.List.Items {
if m.Target == item {
if m == item {
c.SearchMatches = append(c.SearchMatches, i)
break
}