Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion internal/shell/xonsh/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ func ActionRawValues(currentWord string, meta common.Meta, values common.RawValu
for index, val := range values {
val.Value = sanitizer.Replace(val.Value)

appendSpace := !meta.Nospace.Matches(val.Value)

if strings.ContainsAny(val.Value, ` ()[]{}*$?\"|<>&;#`+"`") {
if strings.Contains(val.Value, `\`) {
val.Value = fmt.Sprintf("r'%v'", val.Value) // backslash needs raw string
Expand All @@ -35,7 +37,7 @@ func ActionRawValues(currentWord string, meta common.Meta, values common.RawValu
}
}

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

Expand Down
Loading