Skip to content

Commit

Permalink
julefmt: fix newline detection for structure literals
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Mar 24, 2024
1 parent dc7388f commit 0dc8b07
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/format.jule
Original file line number Diff line number Diff line change
Expand Up @@ -1165,9 +1165,10 @@ impl ExprFormatter {
ret
}
let mut newline = false
let row = lit.exprs[0].token.row
for _, expr in lit.exprs[1:] {
if expr.token.row != row {
for _, expr in lit.exprs {
// Compare with kind row. Because kind and brace should be same line.
// Therefore, kind row also means brace row.
if expr.token.row != lit.kind.token.row {
newline = true
break
}
Expand Down

0 comments on commit 0dc8b07

Please sign in to comment.