refactor: simplify loop in stripTermSequence (#2444)

* refactor: simplify loop in `stripTermSequence`

* more cleanup
This commit is contained in:
Joe Lim authored and GitHub committed 2026-03-20 10:51:45 +11:00
1 parent f940c9b564
commit d85070f69d
2 files changed
+5 -7

No files matched your search

+2 -4
View File
@@ -42,9 +42,8 @@ func (win *win) renew(w, h, x, y int) {
func printLength(s string) int {
length := 0
i := 0
slen := len(s)
for i < slen {
for i := 0; i < slen; {
seq := readTermSequence(s[i:])
if seq != "" {
i += len(seq)
@@ -76,9 +75,8 @@ func (win *win) print(screen tcell.Screen, x, y int, st tcell.Style, s string) t
}
}
i := 0
slen := len(s)
for i < slen {
for i := 0; i < slen; {
seq := readTermSequence(s[i:])
if seq != "" {
put()