Skip to content

Commit

Permalink
fix(ansi): register chroma styles
Browse files Browse the repository at this point in the history
termenv changed the order of profiles, now 1 no longer equals ANSI.
  • Loading branch information
aymanbagabas authored and muesli committed Oct 15, 2022
1 parent dc4e563 commit 50e7d3b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ansi/codeblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 50e7d3b

Please sign in to comment.