Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable auto-finish #55

Open
mvastola opened this issue Apr 15, 2022 · 1 comment
Open

Disable auto-finish #55

mvastola opened this issue Apr 15, 2022 · 1 comment

Comments

@mvastola
Copy link

Describe the problem

So I was hoping to use this gem to show the current status of a buffer in progress bar form. I know the maximum size, so this isn't indeterminate.

My problem? If the buffer gets full, the bar finishes, and there's no way to stop it.

I thought of just adding one to total or something, but that would throw the percentage and bar progress off.

How would the new feature work?

I was thinking an auto_finish: false option, which is checked when currently the bar ends if current == total.

Drawbacks

Can you see any potential drawbacks?

Would need to handle cases where current is set to something > total, but that wouldn't be hard.

@piotrmurach
Copy link
Owner

Hi Mike,

In short, I like your idea. A flag that toggles this behaviour seems most appropriate. I wonder if manual_finish: true would be a better choice to indicate intent. Alternatively, similar to the :clear we could opt for an even shorter option finish: false. Any thoughts?

As for current going over the total value. I'm not sure we would need to worry about it. Once you indicate that you wish to control when the bar finishes it's on you to finish it whenever. You have access to the current value and you know the total. The bar stops progressing visually beyond the allowed size but the various stats will continue. Am I missing something here?

@piotrmurach piotrmurach changed the title [Feature Request] Disable auto-finish Disable auto-finish Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants