diff --git a/src/tui/editor.zig b/src/tui/editor.zig index 27e44e8..9b94420 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -1546,6 +1546,11 @@ pub const Editor = struct { const blame_row = self.get_delta_lines_until_row(cursor.row) orelse return; const commit = buffer.get_vcs_blame(blame_row) orelse return; + var buf: std.Io.Writer.Allocating = .init(self.allocator); + defer buf.deinit(); + _ = buf.writer.print("  {s}, {s}", .{ commit.summary, commit.author }) catch 0; + const msg = buf.written(); + const screen_width = self.view.cols; var space_begin = screen_width; while (space_begin > 0) : (space_begin -= 1) @@ -1557,22 +1562,6 @@ pub const Editor = struct { .bg = if (hl_row) |_| theme.editor_line_highlight.bg else theme.editor_hint.bg, }); - const static_text = "  , "; - const summary_freespace = screen_width -| (space_begin + static_text.len + commit.author.len); - - var buf: std.Io.Writer.Allocating = .init(self.allocator); - defer buf.deinit(); - - if (summary_freespace >= commit.summary.len) { - _ = buf.writer.print("  {s}, {s}", .{ commit.summary, commit.author }) catch 0; - } else if (summary_freespace <= 3) { - _ = buf.writer.print("  {s}", .{commit.author}) catch 0; - } else { - _ = buf.writer.print("  {s}..., {s}", .{ commit.summary[0..summary_freespace -| 3], commit.author }) catch 0; - } - - const msg = buf.written(); - switch (tui.config().inline_vcs_blame_alignment) { .left => { const width = self.plane.window.width;