mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
fix: add padding to SummaryBox for consistent border width
This commit is contained in:
+14
-1
@@ -190,9 +190,22 @@ func SummaryBox(title string, items map[string]string) {
|
||||
lines = append(lines, fmt.Sprintf(" %-10s %s", k+":", v))
|
||||
}
|
||||
|
||||
// Find max line length for consistent box width
|
||||
maxLen := 0
|
||||
for _, line := range lines {
|
||||
if len(line) > maxLen {
|
||||
maxLen = len(line)
|
||||
}
|
||||
}
|
||||
|
||||
// Pad lines to same length
|
||||
content := ""
|
||||
for i, line := range lines {
|
||||
content += line
|
||||
padded := line
|
||||
if len(line) < maxLen {
|
||||
padded = line + strings.Repeat(" ", maxLen-len(line))
|
||||
}
|
||||
content += padded
|
||||
if i < len(lines)-1 {
|
||||
content += "\n"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user