Skip to content

Wrap treats non-spaced CJK sequences as one giant word, leaving large trailing gaps #5495

@vdxz

Description

@vdxz

What happened?

CJK text without spaces is treated as one giant "word" during word wrap. After an English word + space, a long CJK sequence gets forced entirely to the next line, leaving a large blank area at the end of the current line.

|This is an example                                             |
|中文汉字测试段落内容中文汉字测试段落内容      |

Steps to reproduce

Run pi with output containing mixed English and CJK text, e.g. a long CJK sequence following an English word and a space. The CJK block wraps as a whole rather than breaking at character boundaries.

Expected behavior

CJK characters should break naturally at character/grapheme boundaries (like oversize Latin words do in breakLongWord), filling the current line before wrapping:

|This is an example 中文汉字测试段落内容中文汉|
|字测试段落内容.                                                     |

Version

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinginprogressIssue is being worked on

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions