From 3dae82657865318bb128112e34238954a32fb8fa Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Sun, 17 Jul 2022 18:22:00 -0400 Subject: [PATCH] feat(readline): pass suggestions to history searcher callback --- readline/comp-group.go | 2 +- readline/instance.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/readline/comp-group.go b/readline/comp-group.go index 648b7ca..dfe61bb 100644 --- a/readline/comp-group.go +++ b/readline/comp-group.go @@ -88,7 +88,7 @@ func (g *CompletionGroup) updateTabFind(rl *Instance) { if rl.searchMode != HistoryFind { g.Suggestions = g.filterSuggestions(rl) } else { - g.Suggestions = rl.HistorySearcher(string(rl.tfLine)) + g.Suggestions = rl.HistorySearcher(string(rl.tfLine), g.Suggestions) } // Finally, the group computes its new printing settings diff --git a/readline/instance.go b/readline/instance.go index 97372cd..01a792e 100644 --- a/readline/instance.go +++ b/readline/instance.go @@ -201,7 +201,7 @@ type Instance struct { RawInputCallback func([]rune) // called on all input - HistorySearcher func(string) []string + HistorySearcher func(string, []string) []string } // NewInstance is used to create a readline instance and initialise it with sane defaults.