@@ -170,15 +170,15 @@ func (r *resizer) optimizedWidths() (colWidths, rowHeights []int) {
170
170
171
171
// detectTableWidth detects the table width.
172
172
func (r * resizer ) detectTableWidth () int {
173
- return r .maxCharCount () + r .totalPadding () + r .totalBorder ()
173
+ return r .maxCharCount () + r .totalHorizontalPadding () + r .totalHorizontalBorder ()
174
174
}
175
175
176
176
// expandTableWidth expands the table width.
177
177
func (r * resizer ) expandTableWidth () (colWidths , rowHeights []int ) {
178
178
colWidths = r .maxColumnWidths ()
179
179
180
180
for {
181
- totalWidth := sum (colWidths ) + r .totalBorder ()
181
+ totalWidth := sum (colWidths ) + r .totalHorizontalBorder ()
182
182
if totalWidth >= r .tableWidth {
183
183
break
184
184
}
@@ -207,7 +207,7 @@ func (r *resizer) shrinkTableWidth() (colWidths, rowHeights []int) {
207
207
// Cut width of columns that are way too big.
208
208
shrinkBiggestColumns := func (veryBigOnly bool ) {
209
209
for {
210
- totalWidth := sum (colWidths ) + r .totalBorder ()
210
+ totalWidth := sum (colWidths ) + r .totalHorizontalBorder ()
211
211
if totalWidth <= r .tableWidth {
212
212
break
213
213
}
@@ -239,7 +239,7 @@ func (r *resizer) shrinkTableWidth() (colWidths, rowHeights []int) {
239
239
// Cut width of columns that differ the most from the median.
240
240
shrinkToMedian := func () {
241
241
for {
242
- totalWidth := sum (colWidths ) + r .totalBorder ()
242
+ totalWidth := sum (colWidths ) + r .totalHorizontalBorder ()
243
243
if totalWidth <= r .tableWidth {
244
244
break
245
245
}
@@ -343,10 +343,10 @@ func (r *resizer) maxTotal() (maxTotal int) {
343
343
return
344
344
}
345
345
346
- // totalPadding returns the total padding.
347
- func (r * resizer ) totalPadding () (totalPadding int ) {
346
+ // totalHorizontalPadding returns the total padding.
347
+ func (r * resizer ) totalHorizontalPadding () (totalHorizontalPadding int ) {
348
348
for _ , col := range r .columns {
349
- totalPadding += col .xPadding
349
+ totalHorizontalPadding += col .xPadding
350
350
}
351
351
return
352
352
}
@@ -367,8 +367,8 @@ func (r *resizer) xPaddingForCell(i, j int) int {
367
367
return r.yPaddings [i ][j ]
368
368
}
369
369
370
- // totalBorder returns the total border.
371
- func (r * resizer ) totalBorder () int {
370
+ // totalHorizontalBorder returns the total border.
371
+ func (r * resizer ) totalHorizontalBorder () int {
372
372
return (r .columnCount () * r .borderPerCell ()) + r .extraBorder ()
373
373
}
374
374
0 commit comments