From 8739087fe1823b4d2ad35b97558cf31a696625e6 Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Thu, 15 Apr 2021 17:23:25 +0300 Subject: [PATCH] increase lookahead length for color escapes cc #609 --- ui.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui.go b/ui.go index 6201444..bb1db51 100644 --- a/ui.go +++ b/ui.go @@ -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 }