fix: wrong dockerfile background highlight

Ayman Bagabas created

Change summary

ui/common/style.go         | 5 +++--
ui/components/code/code.go | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)

Detailed changes

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
 }

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,