aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorevan <evan@evanw.org>2018-05-23 10:20:53 -0500
committerevan <evan@evanw.org>2018-05-23 10:21:08 -0500
commit9f425f990946798767c10078907bbba187707f9f (patch)
tree91207c1b8a74093caeddf772b7e6e75abb9bb6e1 /ui
parent55e36ad06a2721cf677b6dffd4d5af611a954f23 (diff)
switch fuzzysearch to upstream
Diffstat (limited to 'ui')
-rw-r--r--ui/fuzzy-search-modal.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/ui/fuzzy-search-modal.go b/ui/fuzzy-search-modal.go
index 5d75eaf..836f58e 100644
--- a/ui/fuzzy-search-modal.go
+++ b/ui/fuzzy-search-modal.go
@@ -21,7 +21,7 @@ import (
"sort"
"strconv"
- "github.com/evidlo/fuzzysearch/fuzzy"
+ "github.com/renstrom/fuzzysearch/fuzzy"
"maunium.net/go/gomuks/debug"
"maunium.net/go/gomuks/matrix/rooms"
"maunium.net/go/gomuks/ui/widget"
@@ -93,10 +93,10 @@ func (fs *FuzzySearchModal) changeHandler(str string) {
sort.Sort(fs.matches)
fs.results.Clear()
for _, match := range fs.matches {
- fmt.Fprintf(fs.results, `["%d"]%s[""]%s`, match.Index, match.Target, "\n")
+ fmt.Fprintf(fs.results, `["%d"]%s[""]%s`, match.OriginalIndex, match.Target, "\n")
}
fs.parent.Render()
- fs.results.Highlight(strconv.Itoa(fs.matches[0].Index))
+ fs.results.Highlight(strconv.Itoa(fs.matches[0].OriginalIndex))
fs.results.ScrollToBeginning()
} else {
fs.results.Clear()
@@ -116,15 +116,15 @@ func (fs *FuzzySearchModal) keyHandler(event *tcell.EventKey) *tcell.EventKey {
// Cycle highlighted area to next match
if len(highlights) > 0 {
fs.selected = (fs.selected + 1) % len(fs.matches)
- fs.results.Highlight(strconv.Itoa(fs.matches[fs.selected].Index))
+ fs.results.Highlight(strconv.Itoa(fs.matches[fs.selected].OriginalIndex))
fs.results.ScrollToHighlight()
}
return nil
case tcell.KeyEnter:
// Switch room to currently selected room
if len(highlights) > 0 {
- debug.Print("Fuzzy Selected Room:", fs.roomList[fs.matches[fs.selected].Index].GetTitle())
- fs.mainView.SwitchRoom(fs.roomList[fs.matches[fs.selected].Index].Tags()[0].Tag, fs.roomList[fs.matches[fs.selected].Index])
+ debug.Print("Fuzzy Selected Room:", fs.roomList[fs.matches[fs.selected].OriginalIndex].GetTitle())
+ fs.mainView.SwitchRoom(fs.roomList[fs.matches[fs.selected].OriginalIndex].Tags()[0].Tag, fs.roomList[fs.matches[fs.selected].OriginalIndex])
}
fs.parent.views.RemovePage("fuzzy-search-modal")
fs.parent.app.SetFocus(fs.parent.views)