Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/handlers/graphical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,8 @@ impl GraphicalReportHandler {
let vbar_offset = (start + end) / 2;
let num_left = vbar_offset - start;
let num_right = end - vbar_offset - 1;
// Throws `Formatting argument out of range` when width is above u16::MAX.
let width = start.saturating_sub(highest).min(u16::MAX as usize);
underlines.push_str(
&format!(
"{:width$}{}{}{}",
Expand All @@ -1054,7 +1056,6 @@ impl GraphicalReportHandler {
chars.underline
},
chars.underline.to_string().repeat(num_right),
width = start.saturating_sub(highest),
)
.style(hl.style)
.to_string(),
Expand Down