Whole file
Textualize/rich
The author described this change as “fix issue splitting segments”. It counts as a record because the check below fails on the code as it stood at d14b304aa and passes on aa0929298, with nothing else changed between the two runs.
ProjectTextualize/rich
Fix saved2023-01-06
Sharing licenceMIT · LICENSE
Change size+1 −1
What the code was meant to do, written into the code itself as a save note
fix issue splitting segments
The change
| 119 | 119 | ||
| 120 | 120 | cell_size = get_character_cell_size | |
| 121 | 121 | ||
| 122 | - | pos = int((cut / cell_length) * len(text)) | |
| 122 | + | pos = int((cut / cell_length) * (len(text) - 1)) | |
| 123 | 123 | ||
| 124 | 124 | before = text[:pos] | |
| 125 | 125 | cell_pos = cell_len(before) |
The check that tells the two apart
fail→pass·tests/test_segment.py::test_split_cells_emoji[a1\u3042\uff11\uff11bcdaef-9-result23]
Check file tests/test_segment.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before itd14b304aa45bf0759729f4e066606065daa341c8
Broken version dated2022-12-30
Modulerich.segment
Units changedSegment
Fingerprint8449451444075875
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in Textualize/rich
- 2026-04-12TableDataElement
- 2026-02-01_cell_len
- 2026-01-24get_character_cell_size
- 2025-11-13Fix raw markup printed on prompt errors sometimes
- 2025-05-01fix(panel): fix title missing panel background
- 2024-10-03fix(table): highlight columns added by add_row