Codebase list golang-github-vbauerster-mpb / 686caca
refactoring: bar_filler_spinner: use go-runewidth Vladimir Bauer 5 years ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
22 import (
33 "io"
44 "strings"
5 "unicode/utf8"
65
6 "github.com/mattn/go-runewidth"
77 "github.com/vbauerster/mpb/v5/decor"
88 "github.com/vbauerster/mpb/v5/internal"
99 )
4343 width := internal.WidthForBarFiller(reqWidth, stat.AvailableWidth)
4444
4545 frame := s.frames[s.count%uint(len(s.frames))]
46 frameWidth := utf8.RuneCountInString(frame)
46 frameWidth := runewidth.StringWidth(frame)
4747
4848 if width < frameWidth {
4949 return