Do not process ANSI codes in --preview output at once

Close #598
This commit is contained in:
Junegunn Choi
2016-06-14 21:52:47 +09:00
parent c39c039e15
commit 24e1fabf2e
5 changed files with 19 additions and 24 deletions

View File

@@ -17,7 +17,7 @@ func TestExtractColor(t *testing.T) {
var state *ansiState
clean := "\x1b[0m"
check := func(assertion func(ansiOffsets []ansiOffset, state *ansiState)) {
output, ansiOffsets, newState := extractColor(src, state)
output, ansiOffsets, newState := extractColor(src, state, nil)
state = newState
if output != "hello world" {
t.Errorf("Invalid output: {}", output)