summaryrefslogtreecommitdiffstats
path: root/pkg/gui/editors.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2021-10-18 19:00:03 +1100
committerJesse Duffield <jessedduffield@gmail.com>2021-10-19 09:02:42 +1100
commitca7252ef8ee26affdc2c74f05c9c20196a8d571b (patch)
tree7323ca472558a435f01ae62e123cc2576e1959b3 /pkg/gui/editors.go
parenta496858c629e3c6241b51cf99cd38d6fa1b787bc (diff)
suggest files when picking a path to filter on
async fetching of suggestions remove limit cache the trie for future use more more
Diffstat (limited to 'pkg/gui/editors.go')
-rw-r--r--pkg/gui/editors.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/gui/editors.go b/pkg/gui/editors.go
index b94e6b5bd..430dcfdfe 100644
--- a/pkg/gui/editors.go
+++ b/pkg/gui/editors.go
@@ -77,8 +77,10 @@ func (gui *Gui) defaultEditor(v *gocui.View, key gocui.Key, ch rune, mod gocui.M
if gui.findSuggestions != nil {
input := v.TextArea.GetContent()
- suggestions := gui.findSuggestions(input)
- gui.setSuggestions(suggestions)
+ gui.suggestionsAsyncHandler.Do(func() func() {
+ suggestions := gui.findSuggestions(input)
+ return func() { gui.setSuggestions(suggestions) }
+ })
}
return matched