From bdaa9f9c087096f5b34430ffd40673aad961d24c Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Wed, 5 Mar 2025 09:20:08 -0600 Subject: [PATCH] zig fmt (0.14.0 had some formatter changes) --- examples/scroll.zig | 6 +++--- examples/table.zig | 2 +- src/Image.zig | 2 +- src/vxfw/ScrollBars.zig | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/scroll.zig b/examples/scroll.zig index b520982..b82e095 100644 --- a/examples/scroll.zig +++ b/examples/scroll.zig @@ -86,9 +86,9 @@ const Model = struct { } self.scroll_bars.estimated_content_height = if (self.scroll_bars.estimated_content_height == 800) - @intCast(self.rows.items.len) - else - 800; + @intCast(self.rows.items.len) + else + 800; return ctx.consumeAndRedraw(); } diff --git a/examples/table.zig b/examples/table.zig index b79d1ed..9c357eb 100644 --- a/examples/table.zig +++ b/examples/table.zig @@ -171,7 +171,7 @@ pub fn main() !void { }, .btm => { if (key.matchesAny(&.{ vaxis.Key.up, 'k' }, .{}) and moving) active = .mid - // Run Command and Clear Command Bar + // Run Command and Clear Command Bar else if (key.matchExact(vaxis.Key.enter, .{}) or key.matchExact('j', .{ .ctrl = true })) { const cmd = try cmd_input.toOwnedSlice(); defer alloc.free(cmd); diff --git a/src/Image.zig b/src/Image.zig index 85cc711..233f32c 100644 --- a/src/Image.zig +++ b/src/Image.zig @@ -121,7 +121,7 @@ pub fn draw(self: Image, win: Window, opts: DrawOptions) !void { .rows = win.height, } - // Does the image require horizontal scaling? + // Does the image require horizontal scaling? else if (!fit_x and fit_y) p_opts.size = .{ .cols = win.width, diff --git a/src/vxfw/ScrollBars.zig b/src/vxfw/ScrollBars.zig index 3fac5b6..bcecd91 100644 --- a/src/vxfw/ScrollBars.zig +++ b/src/vxfw/ScrollBars.zig @@ -489,12 +489,12 @@ pub fn draw(self: *ScrollBars, ctx: vxfw.DrawContext) Allocator.Error!vxfw.Surfa }; const max_content_width_f: f32 = if (self.scroll_view.scroll.left + max.width > max_content_width) - // If we've managed to overscroll horizontally for whatever reason - for example if the - // content changes - we make sure the scroll thumb doesn't disappear by increasing the - // max content width to match the current overscrolled position. - @floatFromInt(self.scroll_view.scroll.left + max.width) - else - @floatFromInt(max_content_width); + // If we've managed to overscroll horizontally for whatever reason - for example if the + // content changes - we make sure the scroll thumb doesn't disappear by increasing the + // max content width to match the current overscrolled position. + @floatFromInt(self.scroll_view.scroll.left + max.width) + else + @floatFromInt(max_content_width); self.last_frame_max_content_width = max_content_width; -- 2.54.0