File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ func (t *Table) Render() string {
139139 case Minimum :
140140 selectedWidth = widths [x ]
141141 case Average :
142- selectedWidth = average [x ] + variance [x ]* 2
142+ selectedWidth = average [x ] + variance [x ]* 3
143143 }
144144 }
145145 res += separator
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ package output
1919
2020import (
2121 "fmt"
22+ "unicode/utf8"
2223
2324 "github.com/fatih/color"
2425)
@@ -27,6 +28,8 @@ var red = color.New(color.FgRed).SprintfFunc()
2728var blue = color .New (color .FgBlue ).SprintfFunc ()
2829var green = color .New (color .FgGreen ).SprintfFunc ()
2930var yellow = color .New (color .FgYellow ).SprintfFunc ()
31+ var white = color .New (color .FgWhite ).SprintfFunc ()
32+ var hiWhite = color .New (color .FgHiWhite ).SprintfFunc ()
3033
3134func Red (in string ) * Text {
3235 return & Text {raw : red (in ), clean : in }
@@ -44,6 +47,14 @@ func Yellow(in string) *Text {
4447 return & Text {raw : yellow (in ), clean : in }
4548}
4649
50+ func White (in string ) * Text {
51+ return & Text {raw : white (in ), clean : in }
52+ }
53+
54+ func HiWhite (in string ) * Text {
55+ return & Text {raw : hiWhite (in ), clean : in }
56+ }
57+
4758type TextBox interface {
4859 Len () int
4960 Pad (availableWidth int ) string
@@ -56,7 +67,7 @@ type Text struct {
5667}
5768
5869func (t * Text ) Len () int {
59- return len (t .clean )
70+ return utf8 . RuneCountInString (t .clean )
6071}
6172
6273// func (t *Text) String() string {
You can’t perform that action at this time.
0 commit comments