From a61a61215650565adf3725adcd4bac4f7f046a98 Mon Sep 17 00:00:00 2001 From: rsteube Date: Tue, 20 Jun 2023 17:13:41 +0200 Subject: [PATCH] powershell: fix nospace for quoted values - needs to be checked before altering the value --- internal/shell/powershell/action.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/shell/powershell/action.go b/internal/shell/powershell/action.go index f1ddb85e4..ba2353b61 100644 --- a/internal/shell/powershell/action.go +++ b/internal/shell/powershell/action.go @@ -45,12 +45,13 @@ func ActionRawValues(currentWord string, meta common.Meta, values common.RawValu for _, val := range values { if val.Value != "" { // must not be empty - any empty `''` parameter in CompletionResult causes an error val.Value = sanitizer.Replace(val.Value) + nospace := meta.Nospace.Matches(val.Value) if strings.ContainsAny(val.Value, ` {}()[]*$?\"|<>&(),;#`+"`") { val.Value = fmt.Sprintf("'%v'", val.Value) } - if !meta.Nospace.Matches(val.Value) { + if !nospace { val.Value = val.Value + " " }