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

Rich spinning forever in _split_cells #5141

Closed
gatesn opened this issue Oct 19, 2024 · 3 comments
Closed

Rich spinning forever in _split_cells #5141

gatesn opened this issue Oct 19, 2024 · 3 comments

Comments

@gatesn
Copy link

gatesn commented Oct 19, 2024

See tconbeer/harlequin#659
Started as of: Textualize/rich#3521

Somehow, the _split_cells function is passed a negative value for cut and it sits in an infinite loop.

I don't really understand what this function is doing, but this patch worked well for me!

@@ -122,11 +122,11 @@
             A tuple of two segments.
         """
         text, style, control = segment
         _Segment = Segment
         cell_length = segment.cell_length
-        if cut >= cell_length:
+        if cut < 0 or cut >= cell_length:
             return segment, _Segment("", style, control)

         cell_size = get_character_cell_size

         pos = int((cut / cell_length) * len(text))
Copy link

Thank you for your issue. Give us a little time to review it.

PS. You might want to check the FAQ if you haven't done so already.

This is an automated reply, generated by FAQtory

@gatesn
Copy link
Author

gatesn commented Oct 19, 2024

Apologies, wrong project: Textualize/rich#3532

@gatesn gatesn closed this as completed Oct 19, 2024
Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

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

No branches or pull requests

1 participant