From d66673d4b6bced11a4033cecae9e98f4e7977401 Mon Sep 17 00:00:00 2001 From: erroneousboat Date: Sun, 17 Dec 2017 14:04:15 +0100 Subject: [PATCH] Remove RankFind Doesn't work correctly with next and previous actions --- components/channels.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/components/channels.go b/components/channels.go index ed23a07..775d247 100644 --- a/components/channels.go +++ b/components/channels.go @@ -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 }