This commit is contained in:
Will McGugan 2026-02-01 15:24:39 +00:00
parent 454fcfc92c
commit 31930ddc84
2 changed files with 6 additions and 2 deletions

View File

@ -150,7 +150,9 @@ def _cell_len(text: str, unicode_version: str) -> int:
while index < character_count:
character = text[index]
if character in SPECIAL:
if character == "\ufe0f" and last_measured_character:
if character == "\u200d":
index += 1
elif character == "\ufe0f" and last_measured_character:
total_width += last_measured_character in cell_table.narrow_to_wide
last_measured_character = None
else:

View File

@ -194,7 +194,9 @@ def test_zwj():
assert cell_len("") == 0
assert cell_len("\u200d") == 0
assert cell_len("1\u200d") == 1
assert cell_len("1\u200d2") == 2
# This sequence should really produce 2, but it aligns with with wcwidth
# What gets written to the terminal is anybody's guess, I've seen multiple variations
assert cell_len("1\u200d2") == 1
def test_non_printable():