vbauerster / mpb

multi progress bar for Go cli applications
The Unlicense
2.29k stars 123 forks source link

Leading white space not removable? #123

Closed nilsbeck closed 1 year ago

nilsbeck commented 1 year ago

Hey, i stumbled upon a leading white space that I cannot seem to remove. Here is an example:

frames := []string{"🐰", "🐰", "🥕", "🥕"}
barfiller := mpb.SpinnerStyle(frames...)
bar := progress.New(int64(-1),
    barfiller.PositionLeft(),
    mpb.BarRemoveOnComplete(),
    mpb.BarFillerClearOnComplete(),
    mpb.BarWidth(2),
    mpb.AppendDecorators(
        decor.Name(title),
    ),
)

What do I see? With this code I see bunny and carrot with a leading white space. When I set BarWidth to 1 there is only a white space shown and bunny/carrot are gone.

What do I expect to see? In general the leading white space should be gone and thus, setting the BarWidth to 1 shows bunny/carrot.

Or am I doing something fundamentally wrong here?

vbauerster commented 1 year ago

Try this one BarFillerTrim.

nilsbeck commented 1 year ago

Oh cool. Not sure how I missed this! Fixes my problem!