increase lookahead length for color escapes

cc #609
This commit is contained in:
Gokcehan 2021-04-15 17:23:25 +03:00
parent 628bf408b4
commit 8739087fe1

4
ui.go
View File

@ -171,7 +171,7 @@ func printLength(s string) int {
r, w := utf8.DecodeRuneInString(s[i:])
if r == gEscapeCode && i+1 < len(s) && s[i+1] == '[' {
j := strings.IndexByte(s[i:min(len(s), i+32)], 'm')
j := strings.IndexByte(s[i:min(len(s), i+64)], 'm')
if j == -1 {
continue
}
@ -199,7 +199,7 @@ func (win *win) print(screen tcell.Screen, x, y int, st tcell.Style, s string) t
r, w := utf8.DecodeRuneInString(s[i:])
if r == gEscapeCode && i+1 < len(s) && s[i+1] == '[' {
j := strings.IndexByte(s[i:min(len(s), i+32)], 'm')
j := strings.IndexByte(s[i:min(len(s), i+64)], 'm')
if j == -1 {
continue
}