From 421b4879b1a888192b12699ad9da40863b3f0831 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Mon, 13 Jun 2022 10:34:30 -0400 Subject: [PATCH] fix: wrong dockerfile background highlight --- ui/common/style.go | 5 +++-- ui/components/code/code.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/common/style.go b/ui/common/style.go index 434df0d85127a5b162a1f40c6b808a857d7e545c..1e2c911a79fe31f07f144245667a9459d8091ac1 100644 --- a/ui/common/style.go +++ b/ui/common/style.go @@ -9,10 +9,11 @@ import ( func StyleConfig() gansi.StyleConfig { noColor := "" s := glamour.DarkStyleConfig - // This fixes an issue with the default style config. For example - // highlighting empty spaces with red in Dockerfile type. s.Document.StylePrimitive.Color = &noColor s.CodeBlock.Chroma.Text.Color = &noColor s.CodeBlock.Chroma.Name.Color = &noColor + // This fixes an issue with the default style config. For example + // highlighting empty spaces with red in Dockerfile type. + s.CodeBlock.Chroma.Error.BackgroundColor = &noColor return s } diff --git a/ui/components/code/code.go b/ui/components/code/code.go index b5bdf7c2257e251bc299bf91114993e273b32bba..9c832bc836b7f1437a7488b86ca6f55d95af241a 100644 --- a/ui/components/code/code.go +++ b/ui/components/code/code.go @@ -213,7 +213,7 @@ func (r *Code) renderFile(path, content string, width int) (string, error) { rc := r.renderContext if r.showLineNumber { st := common.StyleConfig() - m := uint(0) + var m uint st.CodeBlock.Margin = &m rc = gansi.NewRenderContext(gansi.Options{ ColorProfile: termenv.TrueColor,