Commit 9f0821e688
Changed files (2)
lib
std
lib/std/zig/parser_test.zig
@@ -3429,6 +3429,21 @@ test "zig fmt: Control flow statement as body of blockless if" {
);
}
+test "zig fmt: " {
+ try testCanonical(
+ \\pub fn sendViewTags(self: Self) void {
+ \\ var it = ViewStack(View).iterator(self.output.views.first, std.math.maxInt(u32));
+ \\ while (it.next()) |node|
+ \\ view_tags.append(node.view.current_tags) catch {
+ \\ c.wl_resource_post_no_memory(self.wl_resource);
+ \\ log.crit(.river_status, "out of memory", .{});
+ \\ return;
+ \\ };
+ \\}
+ \\
+ );
+}
+
const std = @import("std");
const mem = std.mem;
const warn = std.debug.warn;
lib/std/zig/render.zig
@@ -1762,7 +1762,7 @@ fn renderExpression(
}
if (while_node.payload) |payload| {
- const payload_space = Space.Space; //if (while_node.continue_expr != null) Space.Space else block_start_space;
+ const payload_space = if (while_node.continue_expr != null) Space.Space else block_start_space;
try renderExpression(allocator, ais, tree, payload, payload_space);
}