1 parent
f885af55f2
commit
eaaf08e425
1 file changed
+5
-4
@@ -171,7 +171,7 @@ func printLength(s string) int {
|
|||||||
r, w := utf8.DecodeRuneInString(s[i:])
|
r, w := utf8.DecodeRuneInString(s[i:])
|
||||||
|
|
||||||
if r == gEscapeCode && i+1 < len(s) && s[i+1] == '[' {
|
if r == gEscapeCode && i+1 < len(s) && s[i+1] == '[' {
|
||||||
j := strings.IndexByte(s[i:min(len(s), i+64)], 'm')
|
j := strings.IndexAny(s[i:min(len(s), i+64)], "mK")
|
||||||
if j == -1 {
|
if j == -1 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -199,12 +199,13 @@ func (win *win) print(screen tcell.Screen, x, y int, st tcell.Style, s string) t
|
|||||||
r, w := utf8.DecodeRuneInString(s[i:])
|
r, w := utf8.DecodeRuneInString(s[i:])
|
||||||
|
|
||||||
if r == gEscapeCode && i+1 < len(s) && s[i+1] == '[' {
|
if r == gEscapeCode && i+1 < len(s) && s[i+1] == '[' {
|
||||||
j := strings.IndexByte(s[i:min(len(s), i+64)], 'm')
|
j := strings.IndexAny(s[i:min(len(s), i+64)], "mK")
|
||||||
if j == -1 {
|
if j == -1 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if s[i+j] == 'm' {
|
||||||
st = applyAnsiCodes(s[i+2:i+j], st)
|
st = applyAnsiCodes(s[i+2:i+j], st)
|
||||||
|
}
|
||||||
|
|
||||||
i += j
|
i += j
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in new issue
Block a user