Expose Filler's Fill method
Vladimir Bauer
7 years ago
| 33 | 33 |
}
|
| 34 | 34 |
|
| 35 | 35 |
type Filler interface {
|
| 36 | |
fill(w io.Writer, width int, s *decor.Statistics)
|
|
36 |
Fill(w io.Writer, width int, s *decor.Statistics)
|
| 37 | 37 |
}
|
| 38 | 38 |
|
| 39 | 39 |
type (
|
|
| 348 | 348 |
}
|
| 349 | 349 |
|
| 350 | 350 |
if prependCount+s.width+appendCount > termWidth {
|
| 351 | |
s.filler.fill(s.bufB, termWidth-prependCount-appendCount, stat)
|
|
351 |
s.filler.Fill(s.bufB, termWidth-prependCount-appendCount, stat)
|
| 352 | 352 |
} else {
|
| 353 | |
s.filler.fill(s.bufB, s.width, stat)
|
|
353 |
s.filler.Fill(s.bufB, s.width, stat)
|
| 354 | 354 |
}
|
| 355 | 355 |
|
| 356 | 356 |
if !s.trimSpace {
|
| 22 | 22 |
refill *refill
|
| 23 | 23 |
}
|
| 24 | 24 |
|
| 25 | |
func (s *barFiller) fill(w io.Writer, width int, stat *decor.Statistics) {
|
|
25 |
func (s *barFiller) Fill(w io.Writer, width int, stat *decor.Statistics) {
|
| 26 | 26 |
|
| 27 | 27 |
str := string(s.format[rLeft])
|
| 28 | 28 |
|
| 22 | 22 |
alignment SpinnerAlignment
|
| 23 | 23 |
}
|
| 24 | 24 |
|
| 25 | |
func (s *spinnerFiller) fill(w io.Writer, width int, stat *decor.Statistics) {
|
|
25 |
func (s *spinnerFiller) Fill(w io.Writer, width int, stat *decor.Statistics) {
|
| 26 | 26 |
|
| 27 | 27 |
frame := s.frames[stat.Current%int64(len(s.frames))]
|
| 28 | 28 |
frameWidth := utf8.RuneCountInString(frame)
|