Skip to content

[FEATURE]: CJK-aware word boundary navigation in TUI textarea #18604

@xiejiati

Description

@xiejiati

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

The TUI textarea's word navigation (Option+Arrow / Ctrl+Arrow) treats contiguous non-whitespace as a single word. For CJK text like 你好世界hello, pressing Option+Right jumps over the entire block instead of stopping at each word boundary (你好世界hello).

This happens because the underlying Zig word boundary logic has no awareness of CJK word segmentation — it only splits on whitespace.

Proposed solution: Use Intl.Segmenter(undefined, { granularity: 'word' }) (built into Bun/modern runtimes) to replace the four word-movement methods on TextareaRenderable at runtime. This gives proper ICU-based word boundaries for CJK text while keeping ASCII behavior identical.

Related PRs for context:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions