fix(ansi): register chroma styles

termenv changed the order of profiles, now 1 no longer equals ANSI.
This commit is contained in:
Ayman Bagabas
2022-10-15 05:21:37 +02:00
committed by Christian Muehlhaeuser
parent dc4e563549
commit 50e7d3bab8
+2 -1
View File
@@ -8,6 +8,7 @@ import (
"github.com/alecthomas/chroma/quick"
"github.com/alecthomas/chroma/styles"
"github.com/muesli/reflow/indent"
"github.com/muesli/termenv"
)
const (
@@ -75,7 +76,7 @@ func (e *CodeBlockElement) Render(w io.Writer, ctx RenderContext) error {
}
theme := rules.Theme
if rules.Chroma != nil && ctx.options.ColorProfile > 1 {
if rules.Chroma != nil && ctx.options.ColorProfile != termenv.Ascii {
theme = chromaStyleTheme
mutex.Lock()
// Don't register the style if it's already registered.