aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-10-30 13:06:04 +0100
committerRobin Jarry <robin@jarry.cc>2023-10-30 15:42:56 +0100
commit09744e9272eb5a8951b1fb3d8caa034ca56bdef0 (patch)
tree48fa28a845b260b820a5a2835bb334f5bbaa413f
parent3f3f5929519195ad018b50733820ac88edc5373a (diff)
downloadaerc-09744e9272eb5a8951b1fb3d8caa034ca56bdef0.tar.gz
aerc-09744e9272eb5a8951b1fb3d8caa034ca56bdef0.zip
complete: add trailing space after quotes
Currently, completing `:tag +forw` gives: '+forwarded ' instead of simply +forwarded without quotes with an embedded trailing space. Add the suffix *after* quoting. Fixes: abe228b14d97 ("commands: use completion from go-opt") Reported-by: Inwit <inwit@sindominio.net> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Inwit <inwit@sindominio.net>
-rw-r--r--commands/util.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/commands/util.go b/commands/util.go
index a9aa81b3..726669af 100644
--- a/commands/util.go
+++ b/commands/util.go
@@ -234,12 +234,12 @@ func FilterList(valid []string, search, prefix, suffix string, isFuzzy bool) []s
out := make([]string, 0, len(valid))
if isFuzzy {
for _, v := range fuzzy.RankFindFold(search, valid) {
- out = append(out, opt.QuoteArg(prefix+v.Target+suffix))
+ out = append(out, opt.QuoteArg(prefix+v.Target)+suffix)
}
} else {
for _, v := range valid {
if hasCaseSmartPrefix(v, search) {
- out = append(out, opt.QuoteArg(prefix+v+suffix))
+ out = append(out, opt.QuoteArg(prefix+v)+suffix)
}
}
}