mirror of https://github.com/Hilbis/Hilbish
perf(readline): make completion group with passed suggestions instead of looping over history twice
parent
3dae826578
commit
7434d270e4
|
@ -231,9 +231,13 @@ func NewInstance() *Instance {
|
|||
rl.evtKeyPress = make(map[string]func(string, []rune, int) *EventReturn)
|
||||
rl.TempDirectory = os.TempDir()
|
||||
|
||||
rl.HistorySearcher = func(filter string) []string {
|
||||
grps := rl.completeHistory()
|
||||
return grps[0].filterSuggestions(rl)
|
||||
rl.HistorySearcher = func(filter string, suggestions []string) []string {
|
||||
grp := CompletionGroup{
|
||||
DisplayType: TabDisplayMap,
|
||||
MaxLength: 10,
|
||||
Suggestions: suggestions,
|
||||
}
|
||||
return grp.filterSuggestions(rl)
|
||||
}
|
||||
// Registers
|
||||
rl.initRegisters()
|
||||
|
|
Loading…
Reference in New Issue