Codebase list golang-github-vbauerster-mpb / b87a62e
truncate bar if double width style used Vladimir Bauer 6 years ago
1 changed file(s) with 8 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
00 package mpb
11
22 import (
3 "bytes"
34 "io"
45 "unicode/utf8"
56
151152 index++
152153 }
153154
155 if index != len(bb) {
156 buf := new(bytes.Buffer)
157 s.flush(buf, space, bb[:index])
158 io.WriteString(w, runewidth.Truncate(buf.String(), width, "!"))
159 return
160 }
161
154162 s.flush(w, space, bb)
155163 }
156164