-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Open
Labels
Description
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:
- fix(tui): correct pasted preview replacement for CJK and multi-width characters #17034 — CJK character positioning fix
- fix: set Windows console code page to UTF-8 for CJK input #14766 — Windows UTF-8 console CJK input fix
Reactions are currently unavailable