Progress bar reset does not do anything
Hello, I'm not sure if I am doing something wrong however I need the progress bar to be able to dip to a lower percentage when necessary. I am calling "stepTo", however, this does not move the progress bar down if a lower percentage is provided. If I try to call "reset", the bar simply ignores that call and continues on. Is this behavior intended? If so is there a way a change can either be implemented or I can modify the library? I am using Arch Linux with alacrity in the zsh shell.
Actually, I'm sorry, this is my mistake, using the ProgressBarBuilder to continuously update has fixed the issue.
Hello @Bricktheworld , this does seem like a bug to me. Can you paste your minimized snippet here?
Hey @ctongfei, sorry for the late response! Here is a simple example that should show how it can be reproduced, please let me know if you are able to replicate and if you need anything else.
int someProgress = 0;
try (var pb = new ProgressBar("Some progress", 100)) {
while(true) {
Thread.sleep(500);
if (someProgress >= 100) {
pb.reset();
someProgress = 0;
continue;
}
someProgress += 10;
pb.stepTo(someProgress);
}
}
Hi @Bricktheworld sorry for the late response. This is a bug due to a recent optimization that only refreshes the progress bar if it went forward. It did not account for the condition where it stepped backward when calling stepTo. This will be fixed in the next version. Thanks!