From 09744e9272eb5a8951b1fb3d8caa034ca56bdef0 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Mon, 30 Oct 2023 13:06:04 +0100 Subject: 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 Signed-off-by: Robin Jarry Tested-by: Inwit --- commands/util.go | 4 ++-- 1 file 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) } } } -- cgit v1.2.3-54-g00ecf