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.evtKeyPress = make(map[string]func(string, []rune, int) *EventReturn)
|
||||||
rl.TempDirectory = os.TempDir()
|
rl.TempDirectory = os.TempDir()
|
||||||
|
|
||||||
rl.HistorySearcher = func(filter string) []string {
|
rl.HistorySearcher = func(filter string, suggestions []string) []string {
|
||||||
grps := rl.completeHistory()
|
grp := CompletionGroup{
|
||||||
return grps[0].filterSuggestions(rl)
|
DisplayType: TabDisplayMap,
|
||||||
|
MaxLength: 10,
|
||||||
|
Suggestions: suggestions,
|
||||||
|
}
|
||||||
|
return grp.filterSuggestions(rl)
|
||||||
}
|
}
|
||||||
// Registers
|
// Registers
|
||||||
rl.initRegisters()
|
rl.initRegisters()
|
||||||
|
|
Loading…
Reference in New Issue