diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-09-04 16:30:49 -1000 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-09-04 16:30:49 -1000 |
commit | c6b776adbfb11ba34756a1d4f770b15c2fb3cb46 (patch) | |
tree | 54fbfd8931166963311234a9d91d96469fd1c7c4 | |
parent | 5f7809d8259f01fc4a5a3bb3f40b43dc760913a9 (diff) | |
download | aerc-c6b776adbfb11ba34756a1d4f770b15c2fb3cb46.tar.gz |
aerc.go: simplify completions
-rw-r--r-- | aerc.go | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/aerc.go b/aerc.go index bfd12b5..5ba9fab 100644 --- a/aerc.go +++ b/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 { - cmds := getCommands((*aerc).SelectedTab()) - completions := make([]string, 0) - for _, set := range cmds { - opts := set.GetCompletions(aerc, cmd) - if len(opts) > 0 { - for _, opt := range opts { - completions = append(completions, opt) - } - } + var completions []string + for _, set := range getCommands((*aerc).SelectedTab()) { + completions = append(completions, set.GetCompletions(aerc, cmd)...) } return completions } |