zig fmt: Fix rendering of arrays with single row
rowSize used to return null if all the elements were placed on the same line as the right brace, making the rendering logic skip the whole set of elements. Given the usage of rowSize let's just drop the null and always return the number of elements. Fixes #8423
This commit is contained in:
@@ -1812,6 +1812,8 @@ test "zig fmt: array literal veritical column alignment" {
|
||||
\\ 4,5,600,7,
|
||||
\\ 80,
|
||||
\\ 9, 10, 11, 0, 13, 14, 15};
|
||||
\\const a = [12]u8{
|
||||
\\ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||
\\
|
||||
,
|
||||
\\const a = []u8{
|
||||
@@ -1825,6 +1827,9 @@ test "zig fmt: array literal veritical column alignment" {
|
||||
\\ 9, 10, 11, 0, 13,
|
||||
\\ 14, 15,
|
||||
\\};
|
||||
\\const a = [12]u8{
|
||||
\\ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
|
||||
\\};
|
||||
\\
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user