Codebase list golang-github-vbauerster-mpb / 3d8c7e4
use go-runewidth Vladimir Bauer 6 years ago
2 changed file(s) with 6 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
11
22 go 1.14
33
4 require github.com/vbauerster/mpb/v5 v5.1.0
4 require (
5 github.com/mattn/go-runewidth v0.0.9
6 github.com/vbauerster/mpb/v5 v5.1.0
7 )
77 "sync"
88 "time"
99
10 "github.com/mattn/go-runewidth"
1011 "github.com/vbauerster/mpb/v5"
1112 "github.com/vbauerster/mpb/v5/decor"
1213 )
3334 default:
3435 }
3536 if msg != nil {
36 limitFmt := fmt.Sprintf("%%.%ds", st.AvailableWidth)
37 fmt.Fprintf(w, limitFmt, *msg)
37 io.WriteString(w, runewidth.Truncate(*msg, st.AvailableWidth, "…"))
3838 nextCh <- struct{}{}
3939 } else {
4040 base.Fill(w, reqWidth, st)