maxBeforeStatusWidth computes the maximum width before statusPad across all lines. This is: space(1) + spinner(1) + prefix + space(1) + taskID + progress
(lines []lineData)
| 446 | // maxBeforeStatusWidth computes the maximum width before statusPad across all lines. |
| 447 | // This is: space(1) + spinner(1) + prefix + space(1) + taskID + progress |
| 448 | func maxBeforeStatusWidth(lines []lineData) int { |
| 449 | var maxWidth int |
| 450 | for i := range lines { |
| 451 | l := &lines[i] |
| 452 | width := 3 + lenAnsi(l.prefix) + utf8.RuneCountInString(l.taskID) + lenAnsi(l.progress) |
| 453 | if width > maxWidth { |
| 454 | maxWidth = width |
| 455 | } |
| 456 | } |
| 457 | return maxWidth |
| 458 | } |
| 459 | |
| 460 | // computeOverflow calculates how many characters the widest line exceeds the terminal width. |
| 461 | // Returns 0 or negative if all lines fit. |
no test coverage detected