Skip to content

Commit 21adada

Browse files
committed
minor fixes, addl comments
1 parent a20a732 commit 21adada

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

table/render_init.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,13 @@ func (t *Table) initForRenderRowPainterColors() {
268268
}
269269
}
270270

271-
if t.rowPainterWithAttributes != nil {
271+
if t.rowPainter != nil {
272+
t.rowsColors[idxColors] = t.rowPainter(row)
273+
} else if t.rowPainterWithAttributes != nil {
272274
t.rowsColors[idxColors] = t.rowPainterWithAttributes(row, RowAttributes{
273275
Number: idx + 1,
274276
NumberSorted: idxColors + 1,
275277
})
276-
} else if t.rowPainter != nil {
277-
t.rowsColors[idxColors] = t.rowPainter(row)
278278
}
279279
}
280280
}

table/row.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ func (r Row) findColumnNumber(colName string) int {
2020

2121
// RowAttributes contains properties about the Row during the render.
2222
type RowAttributes struct {
23-
Number int
24-
NumberSorted int
23+
Number int // Row Number (1-indexed) as appended
24+
NumberSorted int // Row number (1-indexed) after sorting
2525
}
2626

2727
// RowPainter is a custom function that takes a Row as input and returns the

0 commit comments

Comments
 (0)