Skip to content

Commit 5437e4a

Browse files
committed
fix: ensure that prop is always cleared
1 parent 60534f9 commit 5437e4a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ansi/table.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ func (e *TableElement) setBorders(ctx RenderContext) {
111111

112112
// Finish finishes rendering a TableElement.
113113
func (e *TableElement) Finish(_ io.Writer, ctx RenderContext) error {
114+
defer func() {
115+
ctx.table.lipgloss = nil
116+
}()
117+
114118
rules := ctx.options.Styles.Table
115119

116120
e.setStyles(ctx)
@@ -123,7 +127,6 @@ func (e *TableElement) Finish(_ io.Writer, ctx RenderContext) error {
123127

124128
renderText(ow, ctx.options.ColorProfile, ctx.blockStack.With(rules.StylePrimitive), rules.Suffix)
125129
renderText(ow, ctx.options.ColorProfile, ctx.blockStack.Current().Style.StylePrimitive, rules.BlockSuffix)
126-
ctx.table.lipgloss = nil
127130
return nil
128131
}
129132

0 commit comments

Comments
 (0)