From 902b1d1de0be23294fa88b6d529ad5ed72c8fa4b Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Fri, 25 Oct 2024 11:56:09 -0400 Subject: [PATCH] fix(cellbuf): empty cells mean no styles as well We need to take styles into account when deciding if a cell is empty or not. This is because a cell with no content but with styles is not empty. --- cellbuf/grid.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cellbuf/grid.go b/cellbuf/grid.go index 8a5d212e..a75834f7 100644 --- a/cellbuf/grid.go +++ b/cellbuf/grid.go @@ -90,7 +90,7 @@ func RenderLine(g Grid, n int) (w int, line string) { // We only write the cell content if it's not empty. If it is, we // append it to the pending line and width to be evaluated later. - if len(strings.TrimSpace(cell.Content)) == 0 { + if cell.Style.Empty() && len(strings.TrimSpace(cell.Content)) == 0 { pendingLine += cell.Content pendingWidth += cell.Width } else {