Skip to content

Commit

Permalink
fix(cellbuf): empty cells mean no styles as well
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aymanbagabas committed Oct 25, 2024
1 parent ad25fd0 commit 902b1d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cellbuf/grid.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 902b1d1

Please sign in to comment.