Skip to content

Commit

Permalink
table: do not colorize border using row-painter (fixes #221) (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
jedib0t committed Aug 21, 2022
1 parent 7966e63 commit b3bddf1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion table/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ func (t *Table) getBorderRight(hint renderHint) string {
}

func (t *Table) getColumnColors(colIdx int, hint renderHint) text.Colors {
if t.rowPainter != nil && hint.isRegularRow() && !t.isIndexColumn(colIdx, hint) {
if t.rowPainter != nil && hint.isRegularNonSeparatorRow() && !t.isIndexColumn(colIdx, hint) {
colors := t.rowsColors[hint.rowNumber-1]
if colors != nil {
return colors
Expand Down Expand Up @@ -993,6 +993,10 @@ func (h *renderHint) isRegularRow() bool {
return !h.isHeaderRow && !h.isFooterRow
}

func (h *renderHint) isRegularNonSeparatorRow() bool {
return !h.isHeaderRow && !h.isFooterRow && !h.isSeparatorRow
}

func (h *renderHint) isHeaderOrFooterSeparator() bool {
return h.isSeparatorRow && !h.isBorderBottom && !h.isBorderTop &&
((h.isHeaderRow && !h.isLastRow) || (h.isFooterRow && (!h.isFirstRow || h.rowNumber > 0)))
Expand Down

0 comments on commit b3bddf1

Please sign in to comment.