diff --git a/_examples/tipOnComplete/main.go b/_examples/tipOnComplete/main.go index 7872141..852240e 100644 --- a/_examples/tipOnComplete/main.go +++ b/_examples/tipOnComplete/main.go @@ -15,7 +15,7 @@ total := 100 name := "Single Bar:" bar := p.New(int64(total), - mpb.BarStyle().TipOnComplete(">"), + mpb.BarStyle().TipOnComplete(), mpb.PrependDecorators(decor.Name(name)), mpb.AppendDecorators(decor.Percentage()), ) diff --git a/bar_filler_bar.go b/bar_filler_bar.go index 1db8f0b..d8362dc 100644 --- a/bar_filler_bar.go +++ b/bar_filler_bar.go @@ -3,7 +3,6 @@ import ( "io" - "github.com/acarl005/stripansi" "github.com/mattn/go-runewidth" "github.com/vbauerster/mpb/v8/decor" "github.com/vbauerster/mpb/v8/internal" @@ -15,29 +14,39 @@ iFiller iRefiller iPadding + iTip components ) + +var defaultBarStyle = [...]string{"[", "]", "=", "+", "-", ">"} // BarStyleComposer interface. type BarStyleComposer interface { BarFillerBuilder Lbound(string) BarStyleComposer + LboundMeta(func(...interface{}) string) BarStyleComposer Rbound(string) BarStyleComposer + RboundMeta(func(...interface{}) string) BarStyleComposer Filler(string) BarStyleComposer + FillerMeta(func(...interface{}) string) BarStyleComposer Refiller(string) BarStyleComposer + RefillerMeta(func(...interface{}) string) BarStyleComposer Padding(string) BarStyleComposer - TipOnComplete(string) BarStyleComposer + PaddingMeta(func(...interface{}) string) BarStyleComposer Tip(frames ...string) BarStyleComposer + TipMeta(func(...interface{}) string) BarStyleComposer + TipOnComplete() BarStyleComposer Reverse() BarStyleComposer } type bFiller struct { - rev bool - components [components]*component - tip struct { - count uint - frames []*component - onComplete *component + components [components]component + meta [components]func(io.Writer, ...interface{}) error + rev bool + tipOnComplete bool + tip struct { + frames []component + count uint } } @@ -47,63 +56,96 @@ } type barStyle struct { - lbound string - rbound string - filler string - refiller string - padding string - tipOnComplete string + style [components]string + metaFuncs [components]func(io.Writer, ...interface{}) error tipFrames []string + tipOnComplete bool rev bool } // BarStyle constructs default bar style which can be altered via // BarStyleComposer interface. func BarStyle() BarStyleComposer { - return &barStyle{ - lbound: "[", - rbound: "]", - filler: "=", - refiller: "+", - padding: "-", - tipFrames: []string{">"}, - } + bs := &barStyle{ + style: defaultBarStyle, + tipFrames: []string{defaultBarStyle[iTip]}, + } + defaultMeta := func(w io.Writer, a ...interface{}) (err error) { + for i := 0; i < len(a) && err == nil; i++ { + _, err = w.Write(a[i].([]byte)) + } + return err + } + for i := range bs.metaFuncs { + bs.metaFuncs[i] = defaultMeta + } + return bs } func (s *barStyle) Lbound(bound string) BarStyleComposer { - s.lbound = bound + s.style[iLbound] = bound + return s +} + +func (s *barStyle) LboundMeta(fn func(...interface{}) string) BarStyleComposer { + s.metaFuncs[iLbound] = makeMetaFunc(fn) return s } func (s *barStyle) Rbound(bound string) BarStyleComposer { - s.rbound = bound + s.style[iRbound] = bound + return s +} + +func (s *barStyle) RboundMeta(fn func(...interface{}) string) BarStyleComposer { + s.metaFuncs[iRbound] = makeMetaFunc(fn) return s } func (s *barStyle) Filler(filler string) BarStyleComposer { - s.filler = filler + s.style[iFiller] = filler + return s +} + +func (s *barStyle) FillerMeta(fn func(...interface{}) string) BarStyleComposer { + s.metaFuncs[iFiller] = makeMetaFunc(fn) return s } func (s *barStyle) Refiller(refiller string) BarStyleComposer { - s.refiller = refiller + s.style[iRefiller] = refiller + return s +} + +func (s *barStyle) RefillerMeta(fn func(...interface{}) string) BarStyleComposer { + s.metaFuncs[iRefiller] = makeMetaFunc(fn) return s } func (s *barStyle) Padding(padding string) BarStyleComposer { - s.padding = padding - return s -} - -func (s *barStyle) TipOnComplete(tip string) BarStyleComposer { - s.tipOnComplete = tip + s.style[iPadding] = padding + return s +} + +func (s *barStyle) PaddingMeta(fn func(...interface{}) string) BarStyleComposer { + s.metaFuncs[iPadding] = makeMetaFunc(fn) return s } func (s *barStyle) Tip(frames ...string) BarStyleComposer { if len(frames) != 0 { - s.tipFrames = append(s.tipFrames[:0], frames...) - } + s.tipFrames = frames + } + return s +} + +func (s *barStyle) TipMeta(fn func(...interface{}) string) BarStyleComposer { + s.metaFuncs[iTip] = makeMetaFunc(fn) + return s +} + +func (s *barStyle) TipOnComplete() BarStyleComposer { + s.tipOnComplete = true return s } @@ -113,35 +155,35 @@ } func (s *barStyle) Build() BarFiller { - bf := &bFiller{rev: s.rev} - bf.components[iLbound] = &component{ - width: runewidth.StringWidth(stripansi.Strip(s.lbound)), - bytes: []byte(s.lbound), - } - bf.components[iRbound] = &component{ - width: runewidth.StringWidth(stripansi.Strip(s.rbound)), - bytes: []byte(s.rbound), - } - bf.components[iFiller] = &component{ - width: runewidth.StringWidth(stripansi.Strip(s.filler)), - bytes: []byte(s.filler), - } - bf.components[iRefiller] = &component{ - width: runewidth.StringWidth(stripansi.Strip(s.refiller)), - bytes: []byte(s.refiller), - } - bf.components[iPadding] = &component{ - width: runewidth.StringWidth(stripansi.Strip(s.padding)), - bytes: []byte(s.padding), - } - bf.tip.onComplete = &component{ - width: runewidth.StringWidth(stripansi.Strip(s.tipOnComplete)), - bytes: []byte(s.tipOnComplete), - } - bf.tip.frames = make([]*component, len(s.tipFrames)) + bf := &bFiller{ + meta: s.metaFuncs, + rev: s.rev, + tipOnComplete: s.tipOnComplete, + } + bf.components[iLbound] = component{ + width: runewidth.StringWidth(s.style[iLbound]), + bytes: []byte(s.style[iLbound]), + } + bf.components[iRbound] = component{ + width: runewidth.StringWidth(s.style[iRbound]), + bytes: []byte(s.style[iRbound]), + } + bf.components[iFiller] = component{ + width: runewidth.StringWidth(s.style[iFiller]), + bytes: []byte(s.style[iFiller]), + } + bf.components[iRefiller] = component{ + width: runewidth.StringWidth(s.style[iRefiller]), + bytes: []byte(s.style[iRefiller]), + } + bf.components[iPadding] = component{ + width: runewidth.StringWidth(s.style[iPadding]), + bytes: []byte(s.style[iPadding]), + } + bf.tip.frames = make([]component, len(s.tipFrames)) for i, t := range s.tipFrames { - bf.tip.frames[i] = &component{ - width: runewidth.StringWidth(stripansi.Strip(t)), + bf.tip.frames[i] = component{ + width: runewidth.StringWidth(t), bytes: []byte(t), } } @@ -156,104 +198,93 @@ return nil } - _, err = w.Write(s.components[iLbound].bytes) + err = s.meta[iLbound](w, s.components[iLbound].bytes) if err != nil { return err } if width == 0 { - _, err = w.Write(s.components[iRbound].bytes) - return err - } - - var filling [][]byte - var padding [][]byte - var tip *component - var filled int - var refWidth int + return s.meta[iRbound](w, s.components[iRbound].bytes) + } + + var tip component + var refilling, filling, padding []byte + var fillCount, refWidth int curWidth := int(internal.PercentageRound(stat.Total, stat.Current, uint(width))) - if stat.Completed { - tip = s.tip.onComplete - } else { + if curWidth != 0 && !stat.Completed || s.tipOnComplete { tip = s.tip.frames[s.tip.count%uint(len(s.tip.frames))] - } - - if curWidth > 0 { - filling = append(filling, tip.bytes) - filled += tip.width s.tip.count++ - } - - if stat.Refill > 0 { + fillCount += tip.width + } + + if stat.Refill != 0 { refWidth = int(internal.PercentageRound(stat.Total, stat.Refill, uint(width))) curWidth -= refWidth refWidth += curWidth } - for filled < curWidth { - if curWidth-filled >= s.components[iFiller].width { - filling = append(filling, s.components[iFiller].bytes) - if s.components[iFiller].width == 0 { - break + for curWidth-fillCount >= s.components[iFiller].width { + filling = append(filling, s.components[iFiller].bytes...) + fillCount += s.components[iFiller].width + } + + for refWidth-fillCount >= s.components[iRefiller].width { + refilling = append(refilling, s.components[iRefiller].bytes...) + fillCount += s.components[iRefiller].width + } + + for width-fillCount >= s.components[iPadding].width { + padding = append(padding, s.components[iPadding].bytes...) + fillCount += s.components[iPadding].width + } + + if width-fillCount != 0 { + padding = append(padding, "…"...) + } + + err = flush(w, s.rev, + flushSection{s.meta[iRefiller], refilling}, + flushSection{s.meta[iFiller], filling}, + flushSection{s.meta[iTip], tip.bytes}, + flushSection{s.meta[iPadding], padding}, + ) + if err != nil { + return err + } + return s.meta[iRbound](w, s.components[iRbound].bytes) +} + +type flushSection struct { + meta func(io.Writer, ...interface{}) error + bytes []byte +} + +func flush(w io.Writer, rev bool, sections ...flushSection) error { + if rev { + for i := len(sections) - 1; i >= 0; i-- { + s := sections[i] + err := s.meta(w, s.bytes) + if err != nil { + return err } - filled += s.components[iFiller].width - } else { - filling = append(filling, []byte("…")) - filled++ - } - } - - for filled < refWidth { - if refWidth-filled >= s.components[iRefiller].width { - filling = append(filling, s.components[iRefiller].bytes) - if s.components[iRefiller].width == 0 { - break + } + } else { + for _, s := range sections { + err := s.meta(w, s.bytes) + if err != nil { + return err } - filled += s.components[iRefiller].width - } else { - filling = append(filling, []byte("…")) - filled++ - } - } - - padWidth := width - filled - for padWidth > 0 { - if padWidth >= s.components[iPadding].width { - padding = append(padding, s.components[iPadding].bytes) - if s.components[iPadding].width == 0 { - break - } - padWidth -= s.components[iPadding].width - } else { - padding = append(padding, []byte("…")) - padWidth-- - } - } - - if s.rev { - filling, padding = padding, filling - } - err = flush(w, filling, padding) - if err != nil { - return err - } - _, err = w.Write(s.components[iRbound].bytes) - return err -} - -func flush(w io.Writer, filling, padding [][]byte) error { - for i := len(filling) - 1; i >= 0; i-- { - _, err := w.Write(filling[i]) - if err != nil { - return err - } - } - for i := 0; i < len(padding); i++ { - _, err := w.Write(padding[i]) - if err != nil { - return err } } return nil } + +func makeMetaFunc(fn func(...interface{}) string) func(io.Writer, ...interface{}) error { + return func(w io.Writer, a ...interface{}) (err error) { + for i := 0; i < len(a) && err == nil; i++ { + _, err = io.WriteString(w, fn(string(a[i].([]byte)))) + } + return err + } +} diff --git a/draw_test.go b/draw_test.go index 9a50334..80a1a51 100644 --- a/draw_test.go +++ b/draw_test.go @@ -810,14 +810,14 @@ }{ 3: { { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,60}", total: 60, current: 60, want: " ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,60}trim", total: 60, current: 60, @@ -827,14 +827,14 @@ }, 4: { { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,59}", total: 60, current: 59, want: " [] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,59}trim", total: 60, current: 59, @@ -842,14 +842,14 @@ want: "[=>]", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,60}", total: 60, current: 60, want: " [] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,60}trim", total: 60, current: 60, @@ -859,14 +859,14 @@ }, 5: { { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,59}", total: 60, current: 59, want: " [>] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,59}trim", total: 60, current: 59, @@ -874,14 +874,14 @@ want: "[==>]", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,60}", total: 60, current: 60, want: " [>] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,60}trim", total: 60, current: 60, @@ -891,14 +891,14 @@ }, 6: { { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,59}", total: 60, current: 59, want: " [=>] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,59}trim", total: 60, current: 59, @@ -906,14 +906,14 @@ want: "[===>]", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,60}", total: 60, current: 60, want: " [=>] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,60}trim", total: 60, current: 60, @@ -923,14 +923,14 @@ }, 7: { { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,59}", total: 60, current: 59, want: " [==>] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,59}trim", total: 60, current: 59, @@ -938,14 +938,14 @@ want: "[====>]", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,60}", total: 60, current: 60, want: " [==>] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,60}trim", total: 60, current: 60, @@ -955,14 +955,14 @@ }, 8: { { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,59}", total: 60, current: 59, want: " [===>] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,59}trim", total: 60, current: 59, @@ -970,14 +970,14 @@ want: "[=====>]", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,60}", total: 60, current: 60, want: " [===>] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,60}trim", total: 60, current: 60, @@ -987,14 +987,14 @@ }, 80: { { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,59}", total: 60, current: 59, want: " [==========================================================================>-] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,59}trim", total: 60, current: 59, @@ -1002,7 +1002,7 @@ want: "[============================================================================>-]", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c,bw{60,59,60}", total: 60, current: 59, @@ -1010,7 +1010,7 @@ want: " [========================================================>-] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c,bw{60,59,60}trim", total: 60, current: 59, @@ -1019,14 +1019,14 @@ want: "[========================================================>-]", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,60}", total: 60, current: 60, want: " [===========================================================================>] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{60,60}trim", total: 60, current: 60, @@ -1034,7 +1034,7 @@ want: "[=============================================================================>]", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c,bw{60,60,60}", total: 60, current: 60, @@ -1042,7 +1042,7 @@ want: " [=========================================================>] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c,bw{60,60,60}trim", total: 60, current: 60, @@ -1053,14 +1053,14 @@ }, 99: { { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{100,99}", total: 100, current: 99, want: " [=============================================================================================>-] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{100,99}trim", total: 100, current: 99, @@ -1068,14 +1068,14 @@ want: "[===============================================================================================>-]", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{100,100}", total: 100, current: 100, want: " [==============================================================================================>] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{100,100}trim", total: 100, current: 100, @@ -1083,7 +1083,7 @@ want: "[================================================================================================>]", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c,r{100,100,99}", total: 100, current: 100, @@ -1091,7 +1091,7 @@ want: " [++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c,r{100,100,99}trim", total: 100, current: 100, @@ -1100,16 +1100,16 @@ want: "[++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>]", }, { - style: BarStyle().TipOnComplete("<").Reverse(), - name: `t,c,r{100,100,99}TipOnComplete("<").Reverse()`, + style: BarStyle().Tip("<").TipOnComplete().Reverse(), + name: `t,c,r{100,100,99}.Tip("<").TipOnComplete().Reverse()`, total: 100, current: 100, refill: 99, want: " [<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++] ", }, { - style: BarStyle().TipOnComplete("<").Reverse(), - name: `t,c,r{100,100,99}TipOnComplete("<").Reverse()trim`, + style: BarStyle().Tip("<").TipOnComplete().Reverse(), + name: `t,c,r{100,100,99}.Tip("<").TipOnComplete().Reverse()trim`, total: 100, current: 100, refill: 99, @@ -1117,7 +1117,7 @@ want: "[<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++]", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c,r{100,100,100}", total: 100, current: 100, @@ -1125,7 +1125,7 @@ want: " [++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c,r{100,100,100}trim", total: 100, current: 100, @@ -1134,16 +1134,16 @@ want: "[++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>]", }, { - style: BarStyle().TipOnComplete("<").Reverse(), - name: `t,c,r{100,100,100}TipOnComplete("<").Reverse()`, + style: BarStyle().Tip("<").TipOnComplete().Reverse(), + name: `t,c,r{100,100,100}.Tip("<").TipOnComplete().Reverse()`, total: 100, current: 100, refill: 100, want: " [<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++] ", }, { - style: BarStyle().TipOnComplete("<").Reverse(), - name: `t,c,r{100,100,100}TipOnComplete("<").Reverse()trim`, + style: BarStyle().Tip("<").TipOnComplete().Reverse(), + name: `t,c,r{100,100,100}.Tip("<").TipOnComplete().Reverse()trim`, total: 100, current: 100, refill: 100, @@ -1153,14 +1153,14 @@ }, 100: { { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{100,99}", total: 100, current: 99, want: " [==============================================================================================>-] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{100,99}trim", total: 100, current: 99, @@ -1168,14 +1168,14 @@ want: "[================================================================================================>-]", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{100,100}", total: 100, current: 100, want: " [===============================================================================================>] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c{100,100}trim", total: 100, current: 100, @@ -1183,7 +1183,7 @@ want: "[=================================================================================================>]", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c,r{100,100,99}", total: 100, current: 100, @@ -1191,7 +1191,7 @@ want: " [+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c,r{100,100,99}trim", total: 100, current: 100, @@ -1200,7 +1200,7 @@ want: "[+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>]", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c,r{100,100,100}", total: 100, current: 100, @@ -1208,7 +1208,7 @@ want: " [+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>] ", }, { - style: BarStyle().TipOnComplete(">"), + style: BarStyle().TipOnComplete(), name: "t,c,r{100,100,100}trim", total: 100, current: 100, @@ -1314,8 +1314,8 @@ want: " [===============================================================================================] ", }, { - style: BarStyle().TipOnComplete("だ"), - name: `t,c{100,100}TipOnComplete("だ")`, + style: BarStyle().Tip("だ").TipOnComplete(), + name: `t,c{100,100}.Tip("だ").TipOnComplete()`, total: 100, current: 100, want: " [=============================================================================================だ] ", @@ -1356,22 +1356,22 @@ want: " [ののののののののののののののののののののののののののののののののののののののののののののののの…] ", }, { - style: BarStyle().Filler("の").Tip("だ").TipOnComplete("だ").Padding("つ"), - name: `t,c{100,99}Filler("の").Tip("だ").TipOnComplete("だ").Padding("つ")`, + style: BarStyle().Filler("の").Tip("だ").TipOnComplete().Padding("つ"), + name: `t,c{100,99}Filler("の").Tip("だ").TipOnComplete().Padding("つ")`, total: 100, current: 99, want: " [ののののののののののののののののののののののののののののののののののののののののののののののだ…] ", }, { - style: BarStyle().Filler("の").Tip("だ").TipOnComplete("だ").Padding("つ"), - name: `t,c{100,100}.Filler("の").Tip("だ").TipOnComplete("だ").Padding("つ")`, + style: BarStyle().Filler("の").Tip("だ").TipOnComplete().Padding("つ"), + name: `t,c{100,100}.Filler("の").Tip("だ").TipOnComplete().Padding("つ")`, total: 100, current: 100, want: " […ののののののののののののののののののののののののののののののののののののののののののののののだ] ", }, { - style: BarStyle().Filler("の").Tip("だ").TipOnComplete("だ").Padding("つ").Reverse(), - name: `t,c{100,100}.Filler("の").Tip("だ").TipOnComplete("だ").Padding("つ").Reverse()`, + style: BarStyle().Filler("の").Tip("だ").TipOnComplete().Padding("つ").Reverse(), + name: `t,c{100,100}.Filler("の").Tip("だ").TipOnComplete().Padding("つ").Reverse()`, total: 100, current: 100, want: " [だのののののののののののののののののののののののののののののののののののののののののののののの…] ",