fix(format): preserve flag separators and normalise CRLF input

Assisted-by: GLM 5.3
This commit is contained in:
2026-09-19 23:48:47 +02:00
parent 7aefe6a42d
commit 94e09e8070
2 changed files with 34 additions and 3 deletions
+2 -2
View File
@@ -312,7 +312,7 @@ func spaceBetween(prev, cur token.Token) bool {
return false
case token.Comma:
return false
case token.Star, token.Plus, token.Minus, token.Slash:
case token.Star, token.Plus, token.Minus, token.Slash, token.Pipe:
return false
case token.LShift, token.RShift, token.Arrow, token.At:
return false
@@ -328,7 +328,7 @@ func spaceBetween(prev, cur token.Token) bool {
}
}
switch prev.Kind {
case token.LParen, token.Star, token.Plus, token.Minus, token.Slash:
case token.LParen, token.Star, token.Plus, token.Minus, token.Slash, token.Pipe:
return false
case token.Dollar:
return false