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

fix infinite loop in cropping #5154

Merged
merged 7 commits into from
Oct 22, 2024
Merged

fix infinite loop in cropping #5154

merged 7 commits into from
Oct 22, 2024

Conversation

willmcgugan
Copy link
Collaborator

Fixes #5151

I think the issue was in TextArea.render_line. The previous version of Segment.split_cells was buggy, but may have coicidentally done compensated for this bug.

Segment.split_cells should probably also use an assert. Nobody likes an infinite loop.

@darrenburns Could you take a quick look at this to make sure I'm on the right track? Can you suggest a test?

@darrenburns
Copy link
Member

I'm confused about why the tests weren't already catching this!

@TomJGooding
Copy link
Contributor

I'm confused about why the tests weren't already catching this!

Probably because the tests weren't running against the latest rich version?

@darrenburns
Copy link
Member

darrenburns commented Oct 22, 2024

I ran them locally and they all passed, even when the example failed when run manually (latest version of Rich installed) 🤷

@willmcgugan
Copy link
Collaborator Author

Officially the weirdest bug I've encountered this week. Works with "a". Fails with "w", "x", "y", or "z"

@willmcgugan willmcgugan merged commit 3d65f2b into main Oct 22, 2024
20 checks passed
@willmcgugan willmcgugan deleted the text-area-crop-fix branch October 22, 2024 13:13
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 this pull request may close these issues.

TextArea code editor freezes the app
3 participants