From 11841f688bd12e56c11dc2ae71911a1e25213951 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 25 Oct 2020 19:29:37 +0900 Subject: Add support for text styling using --color Close #1663 --- src/core.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core.go') diff --git a/src/core.go b/src/core.go index 99dde536..bd45df69 100644 --- a/src/core.go +++ b/src/core.go @@ -66,7 +66,7 @@ func Run(opts *Options, revision string) { var lineAnsiState, prevLineAnsiState *ansiState if opts.Ansi { - if opts.Theme != nil { + if opts.Theme.Colored { ansiProcessor = func(data []byte) (util.Chars, *[]ansiOffset) { prevLineAnsiState = lineAnsiState trimmed, offsets, newState := extractColor(string(data), lineAnsiState, nil) @@ -102,7 +102,7 @@ func Run(opts *Options, revision string) { } else { chunkList = NewChunkList(func(item *Item, data []byte) bool { tokens := Tokenize(string(data), opts.Delimiter) - if opts.Ansi && opts.Theme != nil && len(tokens) > 1 { + if opts.Ansi && opts.Theme.Colored && len(tokens) > 1 { var ansiState *ansiState if prevLineAnsiState != nil { ansiStateDup := *prevLineAnsiState -- cgit v1.2.3