We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3148858 + 77883bd commit 8368e01Copy full SHA for 8368e01
1 file changed
print.go
@@ -66,10 +66,15 @@ func printTable(commits map[int]int, b Boundary) {
66
}
67
68
func printCell(val, maxValue int) string {
69
+ digitWidth := 1
70
+ if maxValue > 0 {
71
+ digitWidth = len(fmt.Sprintf("%d", maxValue))
72
+ }
73
+
74
var colorFunc color.Style
75
if val == 0 {
76
colorFunc = color.New(color.FgLightWhite, color.BgBlack)
- return colorFunc.Sprintf(" - ")
77
+ return colorFunc.Sprintf(" %*s ", digitWidth, "-")
78
79
80
if maxValue <= 0 {
@@ -85,7 +90,7 @@ func printCell(val, maxValue int) string {
85
90
} else {
86
91
colorFunc = color.New(color.FgBlack, color.BgBlue)
87
92
88
- return colorFunc.Sprintf(" %2d ", val)
93
+ return colorFunc.Sprintf(" %*d ", digitWidth, val)
89
94
95
96
func printLegend(max int) {
0 commit comments