diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2016-06-14 21:52:47 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2016-06-14 21:52:47 +0900 |
commit | 24e1fabf2e805ad28901618fafe5fd389b599b4e (patch) | |
tree | 81d4317090cc2d0c88e3d00de60c18bc467e0cfe /src/core.go | |
parent | c39c039e155c50bcf8fecc5956c4bdd3b5c6bea1 (diff) |
Do not process ANSI codes in --preview output at once
Close #598
Diffstat (limited to 'src/core.go')
-rw-r--r-- | src/core.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core.go b/src/core.go index 24af0507..fd4bc6cd 100644 --- a/src/core.go +++ b/src/core.go @@ -73,7 +73,7 @@ func Run(opts *Options) { if opts.Theme != nil { var state *ansiState ansiProcessor = func(data []byte) ([]rune, []ansiOffset) { - trimmed, offsets, newState := extractColor(string(data), state) + trimmed, offsets, newState := extractColor(string(data), state, nil) state = newState return []rune(trimmed), offsets } @@ -81,7 +81,7 @@ func Run(opts *Options) { // When color is disabled but ansi option is given, // we simply strip out ANSI codes from the input ansiProcessor = func(data []byte) ([]rune, []ansiOffset) { - trimmed, _, _ := extractColor(string(data), nil) + trimmed, _, _ := extractColor(string(data), nil, nil) return []rune(trimmed), nil } } |