Fix ANSI processor to handle multi-line regions

This commit is contained in:
Junegunn Choi
2015-07-22 14:19:45 +09:00
parent f71ea5f3ea
commit 5e3cb3a4ea
4 changed files with 72 additions and 20 deletions

View File

@@ -378,6 +378,7 @@ func (t *Terminal) printHeader() {
return
}
max := C.MaxY()
var state *ansiState
for idx, lineStr := range t.header {
if !t.reverse {
idx = len(t.header) - idx - 1
@@ -389,7 +390,8 @@ func (t *Terminal) printHeader() {
if line >= max {
break
}
trimmed, colors := extractColor(&lineStr)
trimmed, colors, newState := extractColor(&lineStr, state)
state = newState
item := &Item{
text: trimmed,
index: 0,