Skip to content

Commit

Permalink
Merge pull request #790 from rsteube/fix-powershell-nospace
Browse files Browse the repository at this point in the history
powershell: fix nospace for quoted values
  • Loading branch information
rsteube authored Jun 20, 2023
2 parents bd8337c + a61a612 commit 5abd99b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/shell/powershell/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 + " "
}

Expand Down

0 comments on commit 5abd99b

Please sign in to comment.