Fix attempt to subtract with overflow (#582)#586
Merged
chris-laplante merged 5 commits intoconsole-rs:mainfrom Sep 20, 2023
smoelius:orphan-lines
Merged
Fix attempt to subtract with overflow (#582)#586chris-laplante merged 5 commits intoconsole-rs:mainfrom smoelius:orphan-lines
chris-laplante merged 5 commits intoconsole-rs:mainfrom
smoelius:orphan-lines
Conversation
djc
approved these changes
Sep 8, 2023
Member
djc
left a comment
There was a problem hiding this comment.
LGTM, thanks for digging into this! Will leave this open for other reviews, feel free to ping me in a week or so.
oli-obk
reviewed
Sep 8, 2023
Contributor
Author
|
Sorry, I failed to fix a comment. To whomever keeps approving the workflows: thank you. 🙏 |
oli-obk
approved these changes
Sep 18, 2023
Collaborator
We gotchu :) |
djc
approved these changes
Sep 19, 2023
Member
|
@chris-laplante do you want to do a final review before (squash and) merge? @smoelius thanks for your work in getting this right, and @oli-obk thanks for the reviews! |
chris-laplante
approved these changes
Sep 20, 2023
Collaborator
chris-laplante
left a comment
There was a problem hiding this comment.
Looks good to me! Thanks for the new tests too :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #582
The test
orphan_linesreproduces the panic. The testorphan_lines_message_above_progress_bartries to ensure that messages are still printed correctly following the fix.The proposed fix is to effectively ignore
self.orphan_lines_countmany lines fromreal_lenwhen comparingreal_lento the terminal height.@oli-obk Would you be able to glance at this? 🙏