Width overflow fix
Vladimir Bauer
8 years ago
| 358 | 358 | s.fillBar(s.width) |
| 359 | 359 | barCount := utf8.RuneCount(s.bufB.Bytes()) |
| 360 | 360 | totalCount := prependCount + barCount + appendCount |
| 361 | if totalCount > termWidth { | |
| 362 | s.fillBar(termWidth - prependCount - appendCount) | |
| 361 | if spaceCount := 0; totalCount > termWidth { | |
| 362 | if !s.trimLeftSpace { | |
| 363 | spaceCount++ | |
| 364 | } | |
| 365 | if !s.trimRightSpace { | |
| 366 | spaceCount++ | |
| 367 | } | |
| 368 | s.fillBar(termWidth - prependCount - appendCount - spaceCount) | |
| 363 | 369 | } |
| 364 | 370 | |
| 365 | 371 | return io.MultiReader(s.bufP, s.bufB, s.bufA) |