╭ changed ──────────────╮ │src/ui/Repo/Commits.zig│ ╰───────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │557 for (inner.children.values()) |*child| child.widget.deinit(allocator); │ │558 inner.children.clearAndFree(allocator); │ │559 inner.getFocus().child_id = null; │ │560 - │ │561 - if (commit.stats) |stats| { │ │562 - const text = try std.fmt.allocPrint(self.session.page_arena.allocator(), "+{d}, -{d}", .{ stats.lines_added, stats.lines_removed }); │ │563 - var tb = try wgt.TextBox.init(allocator, text, .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none, .label = " lines changed " });│ │564 - errdefer tb.deinit(allocator); │ │565 - tb.getFocus().mode = .all; │ │566 - try inner.children.put(allocator, tb.getFocus().id, .{ .widget = .{ .text_box = tb }, .rect = null, .min_size = null }); │ │567 - } │ │560 │ │561 switch (self.paneContent(sel)) { │ │562 .message => { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │568 try self.addMessageBox(allocator, inner, commit, .preview); │ │569 if (commit.author != .unknown) { │ │570 var tb = try ui.authorBox(allocator, self.session.page_arena, commit.author); │ │571 + errdefer tb.deinit(allocator); │ │572 + try inner.children.put(allocator, tb.getFocus().id, .{ .widget = .{ .text_box = tb }, .rect = null, .min_size = null }); │ │573 + } │ │574 + if (commit.stats) |stats| { │ │575 + var text: std.Io.Writer.Allocating = .init(allocator); │ │576 + defer text.deinit(); │ │577 + try text.writer.print("lines changed: {d}", .{stats.lines_added + stats.lines_changed}); │ │578 + if (stats.lines_removed != 0) try text.writer.print("\nlines removed: {d}", .{stats.lines_removed}); │ │579 + const bytes_added = stats.bytes_added >= stats.bytes_removed; │ │580 + const bytes = if (bytes_added) stats.bytes_added - stats.bytes_removed else stats.bytes_removed - stats.bytes_added; │ │581 + try text.writer.print("\nbytes {s}: {d}\nfiles changed: {d}", .{ │ │582 + if (bytes_added) "added" else "removed", bytes, stats.files_added + stats.files_changed, │ │583 + }); │ │584 + if (stats.files_removed != 0) try text.writer.print("\nfiles removed: {d}", .{stats.files_removed}); │ │585 + var tb = try wgt.TextBox.init(allocator, text.written(), .{ .border_style = .single, .rounded_corners = true, .wrap_kind = .none, .label = " stats " });│ │586 errdefer tb.deinit(allocator); │ │587 + tb.getFocus().mode = .all; │ │588 try inner.children.put(allocator, tb.getFocus().id, .{ .widget = .{ .text_box = tb }, .rect = null, .min_size = null }); │ │589 } │ │590 try self.addViewFilesLink(allocator, inner, commit.oid); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯