Skip to content

Commit

Permalink
nushell: fix nospace
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Jul 31, 2023
1 parent 1b8c481 commit f218816
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/shell/nushell/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func sanitize(values []common.RawValue) []common.RawValue {
func ActionRawValues(currentWord string, meta common.Meta, values common.RawValues) string {
vals := make([]record, len(values))
for index, val := range sanitize(values) {
nospace := meta.Nospace.Matches(val.Value)
if strings.ContainsAny(val.Value, ` {}()[]<>$&"'|;#\`+"`") {
switch {
case strings.HasPrefix(val.Value, "~"):
Expand All @@ -45,7 +46,7 @@ func ActionRawValues(currentWord string, meta common.Meta, values common.RawValu
}
}

if !meta.Nospace.Matches(val.Value) {
if !nospace {
val.Value = val.Value + " "
}

Expand Down

0 comments on commit f218816

Please sign in to comment.