summaryrefslogtreecommitdiffstats
path: root/src/core.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2020-10-25 19:29:37 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2020-10-25 19:30:41 +0900
commit11841f688bd12e56c11dc2ae71911a1e25213951 (patch)
tree25732a5add40e7d70ac01450ab18e1e133a8e15f /src/core.go
parent03c4f042463b2cf96dbb05fdbd06cfbb4903e6c8 (diff)
Add support for text styling using --color
Close #1663
Diffstat (limited to 'src/core.go')
-rw-r--r--src/core.go4
1 files changed, 2 insertions, 2 deletions
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