[PR #719] [MERGED] word navigation: honor CJK/ASCII boundaries #735

Closed
opened 2026-03-02 23:47:53 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/719
Author: @simonklee
Created: 2/20/2026
Status: Merged
Merged: 2/21/2026
Merged by: @kommander

Base: mainHead: cjk-word-wrapping


📝 Commits (5)

  • 5880e95 fix(textarea): honor CJK/ASCII boundaries in Ctrl+W deletes
  • 18a3d5e tests/utf8_test.zig
  • ec53ae9 edit-buffer: handle CJK word boundaries at script transitions
  • 2d69e53 cleanup examples
  • 25bd76c Merge branch 'main' into cjk-word-wrapping

📊 Changes

5 files changed (+594 additions, -2 deletions)

View changed files

📝 packages/core/src/renderables/__tests__/Textarea.keybinding.test.ts (+191 -0)
📝 packages/core/src/zig/edit-buffer.zig (+23 -0)
📝 packages/core/src/zig/tests/edit-buffer_test.zig (+166 -0)
📝 packages/core/src/zig/tests/utf8_test.zig (+65 -2)
📝 packages/core/src/zig/utf8.zig (+149 -0)

📄 Description

Treat CJK and ASCII runs as separate word classes when computing wrap/word breaks, so backward word deletion stops at script transitions and keeps contiguous Hangul/CJK text grouped.

Currently just focused on correctness + regression lock-in only (mixed-script
boundaries, CJK punctuation, missing Han ranges), while keeping the existing shared findWrapBreaks.

Refactor later

Split editor word boundaries from wrap boundaries (findWordBoundaries + word_offsets), then unify scanners behind better boundary metadata so wrap and editor semantics can chenage independently.

Fix #596


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/719 **Author:** [@simonklee](https://github.com/simonklee) **Created:** 2/20/2026 **Status:** ✅ Merged **Merged:** 2/21/2026 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `cjk-word-wrapping` --- ### 📝 Commits (5) - [`5880e95`](https://github.com/anomalyco/opentui/commit/5880e95cc1b3d221c8d6014a05f10096b709586d) fix(textarea): honor CJK/ASCII boundaries in Ctrl+W deletes - [`18a3d5e`](https://github.com/anomalyco/opentui/commit/18a3d5ef6c3a4231852d18676146a5fb67825116) tests/utf8_test.zig - [`ec53ae9`](https://github.com/anomalyco/opentui/commit/ec53ae91e1c68aa73371d622d8762b3172d6af90) edit-buffer: handle CJK word boundaries at script transitions - [`2d69e53`](https://github.com/anomalyco/opentui/commit/2d69e53ccdb6948c6f3d1b694728c52af194417a) cleanup examples - [`25bd76c`](https://github.com/anomalyco/opentui/commit/25bd76cbdccad490a92cb5cab0b661ea0bfcd21e) Merge branch 'main' into cjk-word-wrapping ### 📊 Changes **5 files changed** (+594 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/renderables/__tests__/Textarea.keybinding.test.ts` (+191 -0) 📝 `packages/core/src/zig/edit-buffer.zig` (+23 -0) 📝 `packages/core/src/zig/tests/edit-buffer_test.zig` (+166 -0) 📝 `packages/core/src/zig/tests/utf8_test.zig` (+65 -2) 📝 `packages/core/src/zig/utf8.zig` (+149 -0) </details> ### 📄 Description Treat CJK and ASCII runs as separate word classes when computing wrap/word breaks, so backward word deletion stops at script transitions and keeps contiguous Hangul/CJK text grouped. Currently just focused on correctness + regression lock-in only (mixed-script boundaries, CJK punctuation, missing Han ranges), while keeping the existing shared `findWrapBreaks`. **Refactor later** Split editor word boundaries from wrap boundaries (`findWordBoundaries` + `word_offsets`), then unify scanners behind better boundary metadata so wrap and editor semantics can chenage independently. Fix #596 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:47:53 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#735
No description provided.