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.

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

119119
120120 cell_size = get_character_cell_size
121121
122- pos = int((cut / cell_length) * len(text))
122+ pos = int((cut / cell_length) * (len(text) - 1))
123123
124124 before = text[:pos]
125125 cell_pos = cell_len(before)

The check that tells the two apart

failpass·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