Repository navigation
Keep combining characters with hyphens when wrapping long words - #309
Apeksha9389 wants to merge 1 commit into
Conversation
|
Can you cite any sources, modern or historic, english or other languages, where ascii hyphen '-' is combined with a combining character? |
|
I don’t have an attested modern or historical language example of ASCII My rationale was the wrapper’s documented guarantee to preserve grapheme boundaries. Unicode’s default grapheme rules GB9/GB9a explain why these inputs form a cluster, but that is not evidence of actual linguistic usage. This is a boundary-consistency edge case; I cannot substantiate a practical language-use case for it. |
|
I have documented my reason for rejecting this in https://wcwidth.readthedocs.io/en/latest/intro.html#unlikely-sequences |
When a long word contains a hyphen followed by a combining mark,
wrap()currently breaks immediately after the hyphen, moving the mark to the next line. For example,wrap("ab-\u0301cdef", 4)returns["ab-", "\u0301cdef"].Include the hyphen's entire grapheme when selecting a hyphen break, then map that boundary back through terminal sequences. The result keeps the accent with its hyphen:
["ab-\u0301", "cdef"].Validation:
git diff --checkpass.Developed and tested with OpenAI Codex assistance.