mirror of
https://github.com/Hilbis/Hilbish
synced 2025-04-21 13:03:22 +00:00
perf(readline): make completion group with passed suggestions instead of looping over history twice
This commit is contained in:
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…
x
Reference in New Issue
Block a user