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:
+3
-2
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user