aerc.go: simplify completions
This commit is contained in:
parent
5f7809d825
commit
c6b776adbf
12
aerc.go
12
aerc.go
|
@ -74,15 +74,9 @@ func execCommand(aerc *widgets.Aerc, ui *libui.UI, cmd []string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func getCompletions(aerc *widgets.Aerc, cmd string) []string {
|
func getCompletions(aerc *widgets.Aerc, cmd string) []string {
|
||||||
cmds := getCommands((*aerc).SelectedTab())
|
var completions []string
|
||||||
completions := make([]string, 0)
|
for _, set := range getCommands((*aerc).SelectedTab()) {
|
||||||
for _, set := range cmds {
|
completions = append(completions, set.GetCompletions(aerc, cmd)...)
|
||||||
opts := set.GetCompletions(aerc, cmd)
|
|
||||||
if len(opts) > 0 {
|
|
||||||
for _, opt := range opts {
|
|
||||||
completions = append(completions, opt)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return completions
|
return completions
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue