diff --git a/internal/tui/exp/diffview/chroma.go b/internal/tui/exp/diffview/chroma.go index 5584c668b6631c934d8e81992b420bcdb34f8d06..01f1f7093a649e0dd0f93e6aa36f56e2faa9f4e1 100644 --- a/internal/tui/exp/diffview/chroma.go +++ b/internal/tui/exp/diffview/chroma.go @@ -7,6 +7,7 @@ import ( "strings" "github.com/alecthomas/chroma/v2" + "github.com/charmbracelet/crush/internal/ansiext" "github.com/charmbracelet/lipgloss/v2" ) @@ -22,6 +23,7 @@ type chromaFormatter struct { func (c chromaFormatter) Format(w io.Writer, style *chroma.Style, it chroma.Iterator) error { for token := it(); token != chroma.EOF; token = it() { value := strings.TrimSuffix(token.Value, "\n") + value = ansiext.Escape(value) entry := style.Get(token.Type) if entry.IsZero() {