From 24e1fabf2e805ad28901618fafe5fd389b599b4e Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Tue, 14 Jun 2016 21:52:47 +0900 Subject: Do not process ANSI codes in --preview output at once Close #598 --- 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 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 } } -- cgit v1.2.3