-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fix frozen-counters bug with multiple #pause commands #124
Conversation
|
I added a new state #utils.loc-prior-newslide to store the location of parent slides. This simplifies the code and improves readability (and performance?) The implementation works well in testing. Sorry for sending multiple comments in a short period. |
Thank! I'll check it out later. |
Thanks, I think your method is more elegant. |
With this PR, we can also add the |
Yes, and that resolves the issue #83. |
Description
This PR addresses a bug in the frozen-counters functionality where status updates show unexpected behavior when using multiple
#pause
commands. This issue may be related to #72.Problem
When using multiple
#pause
commands, figure captions are not correctly incremented. For example, in the example below with multiple figures and pauses, the final figure might be captioned as "Figure 2:" though it should be "Figure 3:".Solution
Instead of storing the counter value at the beginning of a sequence of subslides, we now store the location. We then use
status.at(location)
to rewind the status when needed. This approach ensures that counters are correctly updated across pauses and slides.Testing
I have tested my code with examples given in the examples folder in this repository, besides the example above, and two examples in #72. All of them compiled with no errors / warnings.
#utils.current-slide
) and update it when creating a new slide, instead of querying the label for every new subslide.current
, which is not used, so I deleted it.