diff --git a/bar_filler_bar.go b/bar_filler_bar.go index dc714f0..b63e5e1 100644 --- a/bar_filler_bar.go +++ b/bar_filler_bar.go @@ -1,6 +1,7 @@ package mpb import ( + "bytes" "io" "unicode/utf8" @@ -152,6 +153,13 @@ index++ } + if index != len(bb) { + buf := new(bytes.Buffer) + s.flush(buf, space, bb[:index]) + io.WriteString(w, runewidth.Truncate(buf.String(), width, "!")) + return + } + s.flush(w, space, bb) }