Codebase list golang-github-vbauerster-mpb / 53d9753
Width overflow fix Vladimir Bauer 8 years ago
1 changed file(s) with 8 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
358358 s.fillBar(s.width)
359359 barCount := utf8.RuneCount(s.bufB.Bytes())
360360 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)
363369 }
364370
365371 return io.MultiReader(s.bufP, s.bufB, s.bufA)