Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
pretty dimensional array #1040
While working with a 3D array I found the neat kFormatSingleLineArray option. Anyhow this was not more human-readable than the Default setting and so I created the add-on kFormatPretty2DArray which will limit the print to 1 array per line.
kFormatDefault (one item per line)
kFormatSingleLineArray (Neat but human unreadable for large arrays)
@miloyip - Can you explain me how you would do it in a General way?
At least, please get rid of the local static to avoid threading issues.
Secondly, I think nested objects within an array also constitute a "depth change", even if they are fully completed already when reaching
EndArray(). Having multi-line objects inside a single-line array will also look weird.
Last, but not least, how does you proposal render "mixed" arrays in general?
[ 1, [2, 3], 4, 5, [6, 7], 8 ]
To me, an ideal formatting would be to have only leaf arrays (i.e. not containing arrays or objects) on a single line:
[ 1, [2,3], 4, 5, [6,7], 8 ]
As this might be hard to achieve without backtracking, a newline before a new nesting level might help a bit:
[ 1, [2,3], 4,5, [6,7], 8 ]
I have 3 concerns:
I think the first is of higher priority than the others.