Keep termenv profile in RenderContext

This commit is contained in:
Christian Muehlhaeuser
2020-01-31 14:47:00 +01:00
parent 7467d9e1a5
commit 66b7555d75
9 changed files with 43 additions and 39 deletions
+4 -4
View File
@@ -21,8 +21,8 @@ func (e *BlockElement) Render(w io.Writer, ctx RenderContext) error {
bs := ctx.blockStack
bs.Push(*e)
renderText(w, bs.Parent().Style.StylePrimitive, e.Style.BlockPrefix)
renderText(bs.Current().Block, bs.Current().Style.StylePrimitive, e.Style.Prefix)
renderText(w, ctx.colorProfile, bs.Parent().Style.StylePrimitive, e.Style.BlockPrefix)
renderText(bs.Current().Block, ctx.colorProfile, bs.Current().Style.StylePrimitive, e.Style.Prefix)
return nil
}
@@ -50,8 +50,8 @@ func (e *BlockElement) Finish(w io.Writer, ctx RenderContext) error {
}
}
renderText(w, bs.Current().Style.StylePrimitive, e.Style.Suffix)
renderText(w, bs.Parent().Style.StylePrimitive, e.Style.BlockSuffix)
renderText(w, ctx.colorProfile, bs.Current().Style.StylePrimitive, e.Style.Suffix)
renderText(w, ctx.colorProfile, bs.Parent().Style.StylePrimitive, e.Style.BlockSuffix)
bs.Current().Block.Reset()
bs.Pop()