Compare commits
No commits in common. "1034872e8f4bd17c9a6ac029cdc4eb241d1684cd" and "2749dea1b155fc43d551918306641500ff2a6690" have entirely different histories.
1034872e8f
...
2749dea1b1
1 changed files with 5 additions and 16 deletions
|
|
@ -1546,6 +1546,11 @@ pub const Editor = struct {
|
||||||
const blame_row = self.get_delta_lines_until_row(cursor.row) orelse return;
|
const blame_row = self.get_delta_lines_until_row(cursor.row) orelse return;
|
||||||
const commit = buffer.get_vcs_blame(blame_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;
|
const screen_width = self.view.cols;
|
||||||
var space_begin = screen_width;
|
var space_begin = screen_width;
|
||||||
while (space_begin > 0) : (space_begin -= 1)
|
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,
|
.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) {
|
switch (tui.config().inline_vcs_blame_alignment) {
|
||||||
.left => {
|
.left => {
|
||||||
const width = self.plane.window.width;
|
const width = self.plane.window.width;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue