[PATCH aerc] commands: fix empty entries from completion funcs
Export this patch
Fix the commands.GetTemplates() and types.StrategyStrs() completion
functions to avoid showing empty entries.
Reported-by: pam79
Reported-by: inwit <inwit@sindominio.net>
Signed-off-by: Koni Marti <koni.marti@gmail.com>
---
Acked-by: Robin Jarry <robin@jarry.cc>
Applied, thanks.
To git@git.sr.ht:~rjarry/aerc
9039eba68d65..edeac1a1c6c2 master -> master
commands/commands.go | 2 +-
worker/types/mfs.go | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/commands/commands.go b/commands/commands.go
index a06e8ef9..19bb5d66 100644
--- a/commands/commands.go
+++ b/commands/commands.go
@@ -308,7 +308,7 @@ func GetTemplates(arg string) []string {
}
}
}
- names := make([]string, len(templates))
+ names := make([]string, 0, len(templates))
for n := range templates {
names = append(names, n)
}
diff --git a/worker/types/mfs.go b/worker/types/mfs.go
index 071eda1d..a842082f 100644
--- a/worker/types/mfs.go
+++ b/worker/types/mfs.go
@@ -25,7 +25,7 @@ var StrToStrategy = map[string]MultiFileStrategy{
}
func StrategyStrs() []string {
- strs := make([]string, len(StrToStrategy))
+ strs := make([]string, 0, len(StrToStrategy))
for s := range StrToStrategy {
strs = append(strs, s)
}
--
2.47.0
aerc/patches: SUCCESS in 2m2s
[commands: fix empty entries from completion funcs][0] from [Koni Marti][1]
[0]: https://lists.sr.ht/~rjarry/aerc-devel/patches/55889
[1]: mailto:koni.marti@gmail.com
✓ #1365553 SUCCESS aerc/patches/openbsd.yml https://builds.sr.ht/~rjarry/job/1365553
✓ #1365552 SUCCESS aerc/patches/alpine-edge.yml https://builds.sr.ht/~rjarry/job/1365552
Koni Marti <koni.marti@gmail.com> wrote: