@@ -343,7 +343,7 @@ func (enc *TableEncoder) header() {
343
343
344
344
if enc .title != nil && enc .title .Width != 0 {
345
345
maxWidth := ((enc .tableWidth () - enc .title .Width ) / 2 ) + enc .title .Width
346
- enc .writeAligned (enc .title .Buf , rs . filler , AlignRight , enc .title .Width , maxWidth )
346
+ enc .writeAligned (enc .title .Buf , & rs , AlignRight , enc .title .Width , maxWidth )
347
347
enc .w .Write (enc .newline )
348
348
}
349
349
// draw top border
@@ -430,7 +430,7 @@ func (enc *TableEncoder) divider(rs rowStyle) {
430
430
431
431
for i , width := range enc .maxWidths {
432
432
// column
433
- repeat (enc .w , rs .filler , width )
433
+ rs . filler = repeat (enc .w , rs .filler , width )
434
434
435
435
// line feed indicator
436
436
if rs .hasWrapping && enc .border >= 1 {
@@ -498,9 +498,9 @@ func (enc *TableEncoder) row(vals []*Value, rs rowStyle) {
498
498
width += v .Width
499
499
}
500
500
501
- enc .writeAligned (v .Buf [start :end ], rs . filler , v .Align , width , enc .maxWidths [i ])
501
+ enc .writeAligned (v .Buf [start :end ], & rs , v .Align , width , enc .maxWidths [i ])
502
502
} else {
503
- repeat (enc .w , rs .filler , enc .maxWidths [i ])
503
+ rs . filler = repeat (enc .w , rs .filler , enc .maxWidths [i ])
504
504
}
505
505
506
506
// write newline wrap value
@@ -532,7 +532,7 @@ func (enc *TableEncoder) row(vals []*Value, rs rowStyle) {
532
532
}
533
533
}
534
534
535
- func (enc * TableEncoder ) writeAligned (b , filler []byte , a Align , width , max int ) {
535
+ func (enc * TableEncoder ) writeAligned (b []byte , rs * rowStyle , a Align , width , max int ) {
536
536
// calc padding
537
537
padding := max - width
538
538
paddingLeft := 0
@@ -551,15 +551,15 @@ func (enc *TableEncoder) writeAligned(b, filler []byte, a Align, width, max int)
551
551
552
552
// add padding left
553
553
if paddingLeft > 0 {
554
- repeat (enc .w , filler , paddingLeft )
554
+ rs . filler = repeat (enc .w , rs . filler , paddingLeft )
555
555
}
556
556
557
557
// write
558
558
enc .w .Write (b )
559
559
560
560
// add padding right
561
561
if paddingRight > 0 {
562
- repeat (enc .w , filler , paddingRight )
562
+ rs . filler = repeat (enc .w , rs . filler , paddingRight )
563
563
}
564
564
}
565
565
@@ -780,7 +780,7 @@ func (enc *ExpandedEncoder) record(i int, vals []*Value, rs rowStyle) {
780
780
enc .w .WriteString (header )
781
781
padding := enc .maxWidths [0 ] + enc .maxWidths [1 ] + runewidth .StringWidth (string (headerRS .middle ))* 2 - len (header ) - 1
782
782
if padding > 0 {
783
- repeat (enc .w , headerRS .filler , padding )
783
+ headerRS . filler = repeat (enc .w , headerRS .filler , padding )
784
784
}
785
785
// write newline wrap value
786
786
enc .w .Write (headerRS .filler )
0 commit comments