Skip to content

Commit 38b12a2

Browse files
committed
allow customizing of duplicate str in tables
1 parent 5a69326 commit 38b12a2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

ui/table/interfaces.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type Table struct {
2222
HeaderFormatFunc func(string, ...interface{}) string
2323
DataOnly bool
2424
FillFirstColumn bool
25+
DuplicateStr string
2526
BackgroundStr string
2627
BorderStr string
2728
Transpose bool

ui/table/table.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ func (t Table) AsRows() [][]Value {
5858
if lastVal == nil {
5959
lastVal = r[0]
6060
} else if lastVal.String() == r[0].String() {
61-
r[0] = ValueString{"~"}
61+
if len(t.DuplicateStr) > 0 {
62+
r[0] = ValueString{t.DuplicateStr}
63+
} else {
64+
r[0] = ValueString{"^"}
65+
}
6266
} else {
6367
lastVal = r[0]
6468
}

0 commit comments

Comments
 (0)