diff --git a/bar_filler_bar.go b/bar_filler_bar.go index 89c4893..8c7bc86 100644 --- a/bar_filler_bar.go +++ b/bar_filler_bar.go @@ -115,13 +115,13 @@ func (s *barFiller) Fill(w io.Writer, reqWidth int, stat decor.Statistics) { width := internal.WidthForBarFiller(reqWidth, stat.AvailableWidth) + brackets := s.rwidth[rLeft] + s.rwidth[rRight] + if width < brackets { + return + } + // don't count brackets as progress + width -= brackets - if brackets := s.rwidth[rLeft] + s.rwidth[rRight]; width < brackets { - return - } else { - // don't count brackets as progress - width -= brackets - } w.Write(s.format[rLeft]) defer w.Write(s.format[rRight])