File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -376,6 +376,9 @@ bool StyledWriter::isMultineArray(const Value& value) {
376376 addChildValues_ = true ;
377377 int lineLength = 4 + (size - 1 ) * 2 ; // '[ ' + ', '*n + ' ]'
378378 for (int index = 0 ; index < size; ++index) {
379+ if (hasCommentForValue (value[index])) {
380+ isMultiLine = true ;
381+ }
379382 writeValue (value[index]);
380383 lineLength += int (childValues_[index].length ());
381384 }
@@ -584,6 +587,9 @@ bool StyledStreamWriter::isMultineArray(const Value& value) {
584587 addChildValues_ = true ;
585588 int lineLength = 4 + (size - 1 ) * 2 ; // '[ ' + ', '*n + ' ]'
586589 for (int index = 0 ; index < size; ++index) {
590+ if (hasCommentForValue (value[index])) {
591+ isMultiLine = true ;
592+ }
587593 writeValue (value[index]);
588594 lineLength += int (childValues_[index].length ());
589595 }
Original file line number Diff line number Diff line change 1+ // Comment for array
2+ .=[]
3+ // Comment within array
4+ .[0]="one-element"
Original file line number Diff line number Diff line change 1+ // Comment for array
2+ [
3+ // Comment within array
4+ " one-element"
5+ ]
You can’t perform that action at this time.
0 commit comments