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

Spinners no longer advance #433

Closed
rteabeault opened this issue May 19, 2022 · 3 comments · Fixed by #434
Closed

Spinners no longer advance #433

rteabeault opened this issue May 19, 2022 · 3 comments · Fixed by #434
Assignees

Comments

@rteabeault
Copy link

It appears that commit 6697ac3 has broken spinners. After this commit spinners no longer spin.

Run cargo run --example yarnish before and at this commit to see the difference.

@chris-laplante chris-laplante self-assigned this May 19, 2022
@chris-laplante
Copy link
Collaborator

Good catch, thanks! I'm working on a fix now and will add a test so it doesn't happen again.

@chris-laplante
Copy link
Collaborator

chris-laplante commented May 19, 2022

@djc any idea why we check for tick != 0?

This broke because I removed the check for a ticker being installed (since BarState no longer knows about the ticker). But I wonder whether we can just change this to always increment tick?

indicatif/src/state.rs

Lines 105 to 109 in 2ca9d01

pub(crate) fn tick(&mut self, now: Instant) {
if self.state.tick == 0 {
self.state.tick = self.state.tick.saturating_add(1);
}

There's a similar check in ticker which I also question:

if state.state.tick != 0 {
state.state.tick = state.state.tick.saturating_add(1);
}
state.draw(false, Instant::now()).ok();

@djc
Copy link
Member

djc commented May 19, 2022

No, I don't quite understand why we check for tick != 0. I think this was introduced all the way back in a889b3a? My intuition was that it's maybe a sentinel for if there's even a spinner kind of thing that we need to tick, but I don't think that's it?

@mitsuhiko do you remember what the intention there was?

chris-laplante added a commit to chris-laplante/indicatif that referenced this issue May 20, 2022
@djc djc closed this as completed in #434 May 24, 2022
djc pushed a commit that referenced this issue May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants