One function
_cell_len in Textualize/rich
The author described this change as “fix test”. It counts as a record because the check below fails on the code as it stood at 454fcfc92 and passes on 31930ddc8, with nothing else changed between the two runs.
ProjectTextualize/rich
Fix saved2026-02-01
Sharing licenceMIT · LICENSE
Change size+3 −1
What the code was meant to do, written into the code itself as a docstring
Get the cell length of a string (length as it appears in the terminal). Args: text: String to measure. unicode_version: Unicode version, `"auto"` to auto detect, `"latest"` for the latest unicode version. Returns: Length of string in terminal cells.
The change
| 32 | 32 | while index < character_count: | |
| 33 | 33 | character = text[index] | |
| 34 | 34 | if character in SPECIAL: | |
| 35 | - | if character == "\ufe0f" and last_measured_character: | |
| 35 | + | if character == "\u200d": | |
| 36 | + | index += 1 | |
| 37 | + | elif character == "\ufe0f" and last_measured_character: | |
| 36 | 38 | total_width += last_measured_character in cell_table.narrow_to_wide | |
| 37 | 39 | last_measured_character = None | |
| 38 | 40 | else: |
The check that tells the two apart
fail→pass·tests/test_cells.py::test_split_graphemes[\U0001f469\u200d\U0001f527-expected_spans5-2]
Check file tests/test_cells.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 it454fcfc92c66556f9538d420b5bd3ba95b1f57b7
Broken version dated2026-02-01
Modulerich.cells
Units changed_cell_len
Fingerprint4a00fbf83a40d51c
Checked2026-08-17 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-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
- 2023-01-06fix issue splitting segments