Closed colecrouter closed 3 years ago
I don't plan to change default bar filler, but don't mind having an alternative implementation.
You have altered default bar filler implementation. I don't want to make breaking changes. Please do your implementation in subpackage, so it will coexists with default one.
What I'm expecting to see at the end:
import (
"github.com/vbauerster/mpb/v6"
cbf "github.com/vbauerster/mpb/v6/your-cool-barfiller"
"github.com/vbauerster/mpb/v6/decor"
)
func main() {
p := mpb.New()
bar := p.Add(100,
cbf.NewBarFiller("╢","▌","▌","░","╟"),
...
)
}
I misunderstood what you said earlier about implementation; my bad.
I've gone ahead and added a BarComplexFiller
type (same way as SpinnerFiller
, along with it's own functions, as an extended implementation of BarFiller
. I also added an example in _examples/
.
This shouldn't change/break the current implemented methods. Let me know if this works. Thanks.
NewBarComplexFillerRev
didn't work for me and I still want it to be in subpackage.
I think I've got this nested package set up like you describe. I also fixed the issue with Rev
. I had trouble testing it with the nested package, but I think I have it figured out; if you pull the fork, then uncomment line 7 in the go.mod
for _examples/fillerComplex/
, it should run.
I've implemented this feature in v7.
Before:
After:
Keeps all previous mechanics in place, such as
uniseg.NewGraphemes()
, andutf8.ValidString()
. Added edge case for Bash colour codes to fix the width. Tested with all examples, works fine. Testing with my own custom filler (with colours), works fine:Updated docs and examples as best as I can see, everything compiles and runs no problem. Please let me know if I overlooked something.