feat: add separate config option for vcs blame alignment

This commit is contained in:
CJ van den Berg 2026-01-27 15:45:56 +01:00
parent 049cecdae6
commit 032b1ae14a
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 4 additions and 4 deletions

View file

@ -20,6 +20,7 @@ whitespace_mode: WhitespaceMode = .indent,
inline_diagnostics: bool = true,
inline_diagnostics_alignment: Alignment = .right,
inline_vcs_blame: bool = false,
inline_vcs_blame_alignment: Alignment = .right,
animation_min_lag: usize = 0, //milliseconds
animation_max_lag: usize = 50, //milliseconds
hover_time_ms: usize = 500, //milliseconds

View file

@ -1479,14 +1479,13 @@ pub const Editor = struct {
.bg = if (hl_row) |_| theme.editor_line_highlight.bg else theme.editor_hint.bg,
});
// Opposite as diagnostics
switch (tui.config().inline_diagnostics_alignment) {
.right => {
switch (tui.config().inline_vcs_blame_alignment) {
.left => {
const width = self.plane.window.width;
self.plane.cursor_move_yx(@intCast(pos.row), @intCast(width -| (screen_width - space_begin) + 2));
_ = self.plane.print("{s}", .{msg}) catch 0;
},
.left => _ = self.plane.print_aligned_right(@intCast(pos.row), "{s}", .{msg[0..@min(screen_width - space_begin, msg.len)]}) catch {},
.right => _ = self.plane.print_aligned_right(@intCast(pos.row), "{s}", .{msg[0..@min(screen_width - space_begin, msg.len)]}) catch {},
}
}
}