fix: clip inline blame instead of hiding long metadata

The full-label width check hid current-line attribution when only part of the commit metadata fit. Render into the remaining cells without covering source text; preserve offscreen and no-space guards.
This commit is contained in:
Valdemar Lorenzen
2026-10-20 12:06:54 +02:00
parent 4fb1be7972
commit eae3bdba16
5 changed files with 49 additions and 3 deletions
+3 -2
View File
@@ -3230,8 +3230,9 @@ fn paint_editor_line(
fn paint_inline_blame(frame: &mut Frame, label: &str, line: &str, area: Rect, left: usize) {
let end = display_column(line, usize::MAX);
let start = end.saturating_sub(left).saturating_add(2);
let label_width = UnicodeWidthStr::width(label);
if end >= left && start.saturating_add(label_width) <= usize::from(area.width) {
let label_width =
UnicodeWidthStr::width(label).min(usize::from(area.width).saturating_sub(start));
if end >= left && label_width > 0 {
frame.render_widget(
Paragraph::new(label).style(Style::default().fg(Color::DarkGray)),
Rect::new(area.x + start as u16, area.y, label_width as u16, 1),