zig fmt: fix block lbrace indent
This commit is contained in:
committed by
Andrew Kelley
parent
aaf13a2bb3
commit
837cd748a8
@@ -2703,28 +2703,28 @@ test "zig fmt: catch" {
|
||||
);
|
||||
}
|
||||
|
||||
//test "zig fmt: blocks" {
|
||||
// try testCanonical(
|
||||
// \\test "blocks" {
|
||||
// \\ {
|
||||
// \\ const a = 0;
|
||||
// \\ const b = 0;
|
||||
// \\ }
|
||||
// \\
|
||||
// \\ blk: {
|
||||
// \\ const a = 0;
|
||||
// \\ const b = 0;
|
||||
// \\ }
|
||||
// \\
|
||||
// \\ const r = blk: {
|
||||
// \\ const a = 0;
|
||||
// \\ const b = 0;
|
||||
// \\ };
|
||||
// \\}
|
||||
// \\
|
||||
// );
|
||||
//}
|
||||
//
|
||||
test "zig fmt: blocks" {
|
||||
try testCanonical(
|
||||
\\test "blocks" {
|
||||
\\ {
|
||||
\\ const a = 0;
|
||||
\\ const b = 0;
|
||||
\\ }
|
||||
\\
|
||||
\\ blk: {
|
||||
\\ const a = 0;
|
||||
\\ const b = 0;
|
||||
\\ }
|
||||
\\
|
||||
\\ const r = blk: {
|
||||
\\ const a = 0;
|
||||
\\ const b = 0;
|
||||
\\ };
|
||||
\\}
|
||||
\\
|
||||
);
|
||||
}
|
||||
|
||||
//test "zig fmt: switch" {
|
||||
// try testCanonical(
|
||||
// \\test "switch" {
|
||||
|
||||
@@ -1768,8 +1768,8 @@ fn renderBlock(
|
||||
return renderToken(ais, tree, lbrace + 1, space); // rbrace
|
||||
}
|
||||
|
||||
ais.pushIndent();
|
||||
try renderToken(ais, tree, lbrace, .Newline);
|
||||
ais.pushIndent();
|
||||
for (statements) |stmt, i| {
|
||||
switch (node_tags[stmt]) {
|
||||
.GlobalVarDecl => try renderVarDecl(ais, tree, tree.globalVarDecl(stmt)),
|
||||
|
||||
Reference in New Issue
Block a user