From b82c582a832e0e7bdc4c165ee29b9d43a82aee33 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 22 Apr 2025 21:28:09 +0200 Subject: [PATCH] feat: add some whitespace to branch widget --- src/tui/status/branch.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tui/status/branch.zig b/src/tui/status/branch.zig index f4bd492..a505d9f 100644 --- a/src/tui/status/branch.zig +++ b/src/tui/status/branch.zig @@ -64,12 +64,14 @@ fn process_git( return true; } +const format = " {s} {s} "; + pub fn layout(self: *Self) Widget.Layout { const branch = self.branch orelse return .{ .static = 0 }; var buf: [256]u8 = undefined; var fbs = std.io.fixedBufferStream(&buf); const writer = fbs.writer(); - writer.print("{s} {s}", .{ branch_symbol, branch }) catch {}; + writer.print(format, .{ branch_symbol, branch }) catch {}; const len = self.plane.egc_chunk_width(fbs.getWritten(), 0, 1); return .{ .static = len }; } @@ -82,7 +84,7 @@ pub fn render(self: *Self, theme: *const Widget.Theme) bool { self.plane.set_style(theme.statusbar); self.plane.fill(" "); self.plane.home(); - _ = self.plane.print("{s} {s}", .{ branch_symbol, branch }) catch {}; + _ = self.plane.print(format, .{ branch_symbol, branch }) catch {}; return false; }