Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #261 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 27 27
Lines 2008 2008
Branches 469 468 -1
=========================================
Hits 2008 2008 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will degrade performance by 20.67%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | test_wrap_japanese |
6.6 ms | 8.3 ms | -20.67% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing jakezwang:fix/wrap-hyphen-display-width (1981ab7) with master (329d19c)
|
Thank you @jakezwang , don’t worry about the codspeed results, I’ll take the PR from here. |
Original description:
> wrap('古古-1abcdef', 4) currently produces a first line of 古古-, which occupies five columns. The
> hyphen search compares codepoint positions with the available display width. It also misses valid
> hyphen breaks after combining characters.
>
> Find the prefix that fits using the existing grapheme-aware width helper, then search that prefix
> for the last hyphen. Adds regression cases for CJK text, combining marks, and wide emoji.
>
> Validation: the full test suite passes on Python 3.8–3.14 and 3.15rc (1605 passed, 11 optional
> data-fixture skips per version). All CI lint, formatting, type, documentation, and package checks
> pass.
Closes jquast#261
---------
Co-authored-by: Jake Wang <[email protected]>
wrap('古古-1abcdef', 4)currently produces a first line of古古-, which occupies five columns. The hyphen search compares codepoint positions with the available display width. It also misses valid hyphen breaks after combining characters.Find the prefix that fits using the existing grapheme-aware width helper, then search that prefix for the last hyphen. Adds regression cases for CJK text, combining marks, and wide emoji.
Validation: the full test suite passes on Python 3.8–3.14 and 3.15rc (1605 passed, 11 optional data-fixture skips per version). All CI lint, formatting, type, documentation, and package checks pass.