From cbbdaf632b322eadd915ba9659f873f8213d64f1 Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Sat, 14 Oct 2023 08:51:08 +0200 Subject: [PATCH] Always use style color for plain text Before this change, it only worked on 16M color terminals. After there's a Chroma release with https://github.com/alecthomas/chroma/pull/869 in it we should revert back to "None" here and use the new Chroma release instead. --- m/pager.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/m/pager.go b/m/pager.go index f1506251..52de54eb 100644 --- a/m/pager.go +++ b/m/pager.go @@ -450,7 +450,12 @@ func (p *Pager) initStyle() { stringBuilder := strings.Builder{} err := (*p.ChromaFormatter).Format(&stringBuilder, p.ChromaStyle, chroma.Literator(chroma.Token{ - Type: chroma.None, + // FIXME: They Type here should really be None. "Background" is a + // workaround until we can bump Chroma to a release with this change in + // it: + // https://github.com/alecthomas/chroma/pull/869 + Type: chroma.Background, + Value: "XXX", })) if err != nil {