Skip to content

Commit

Permalink
fix: use the lineWidth option for line breaking in flow collection
Browse files Browse the repository at this point in the history
This should address issues eemeli#288 and eemeli#507.
  • Loading branch information
no92 committed Feb 12, 2024
1 parent b7696fc commit 1954cac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stringify/stringifyCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function stringifyFlowCollection(
} else {
if (!reqNewline) {
const len = lines.reduce((sum, line) => sum + line.length + 2, 2)
reqNewline = len > Collection.maxFlowStringSingleLineLength
reqNewline = (ctx.options.lineWidth != 0 && len > ctx.options.lineWidth)
}
if (reqNewline) {
str = start
Expand Down

0 comments on commit 1954cac

Please sign in to comment.