Skip to content

Commit 13d002a

Browse files
committed
header color padding fixes
1 parent 60da921 commit 13d002a

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

internal/cmd/root.go

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -474,27 +474,17 @@ func displayTableStats(stats *StatsCollector) {
474474
return bold + color + s + reset
475475
}
476476

477-
head := fmt.Sprintf("│ %-*s │ %*s │ %-*s │ %-*s │",
478-
repoCol, colorizeBold("Repository", blue),
479-
colWidths[1], colorizeBold("PRs Combined", blue),
480-
colWidths[2], colorizeBold("Skipped", blue),
481-
colWidths[3], colorizeBold("Status", blue),
482-
)
483-
// Fix header pipe padding: ensure each header cell is padded to match the body
484-
headRunes := []rune(head)
485-
// Replace single spaces before and after pipes with nothing, then add a single space after each pipe
486-
headFixed := ""
487-
for i := 0; i < len(headRunes); i++ {
488-
headFixed += string(headRunes[i])
489-
if headRunes[i] == '│' && i+1 < len(headRunes) && headRunes[i+1] != ' ' {
490-
headFixed += " "
491-
}
477+
// Build header row with correct alignment and color, matching body formatting
478+
headCells := []string{
479+
fmt.Sprintf("%-*s", repoCol, colorizeBold("Repository", blue)),
480+
fmt.Sprintf("%*s", colWidths[1], colorizeBold("PRs Combined", blue)),
481+
fmt.Sprintf("%-*s", colWidths[2], colorizeBold("Skipped", blue)),
482+
fmt.Sprintf("%-*s", colWidths[3], colorizeBold("Status", blue)),
492483
}
493-
// Remove any double spaces
494-
headFixed = strings.ReplaceAll(headFixed, " ", " ")
484+
head := "│ " + strings.Join(headCells, " │ ") + " │"
495485

496486
fmt.Println(top)
497-
fmt.Println(headFixed)
487+
fmt.Println(head)
498488
fmt.Println(sep)
499489

500490
for _, repoStat := range stats.PerRepoStats {

0 commit comments

Comments
 (0)