[PR #567] [MERGED] fix(core): adjust for graphemes width when calculating word boundaries #623

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

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/567
Author: @CruelAddict
Created: 1/21/2026
Status: Merged
Merged: 1/24/2026
Merged by: @kommander

Base: mainHead: word-boundary-detection-fix


📝 Commits (6)

  • 6aa0228 fix(core): adjust for graphemes width when calculating word boundaries
  • 7e701fe Merge branch 'main' into word-boundary-detection-fix
  • 4255bfb Merge branch 'main' into word-boundary-detection-fix
  • f32b831 fix(core): take break width into account when calculating boundary width
  • 8db0d27 Merge branch 'main' into word-boundary-detection-fix
  • 866bf95 Merge branch 'main' into word-boundary-detection-fix

📊 Changes

6 files changed (+225 additions, -18 deletions)

View changed files

📝 packages/core/src/edit-buffer.test.ts (+39 -0)
📝 packages/core/src/zig/edit-buffer.zig (+21 -5)
📝 packages/core/src/zig/tests/edit-buffer_test.zig (+57 -0)
📝 packages/core/src/zig/tests/text-buffer-view_test.zig (+66 -0)
📝 packages/core/src/zig/text-buffer-iterators.zig (+38 -0)
📝 packages/core/src/zig/text-buffer-view.zig (+4 -13)

📄 Description

PR on issue #566

Added a helper calculating column delta and applied it to getPrevWordBoundary and getNextWordBoundary. The algorithm is basically reused from segment_callback

Disclaimer: I don't really know zig and this is my first time using it :)


🔄 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/567 **Author:** [@CruelAddict](https://github.com/CruelAddict) **Created:** 1/21/2026 **Status:** ✅ Merged **Merged:** 1/24/2026 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `word-boundary-detection-fix` --- ### 📝 Commits (6) - [`6aa0228`](https://github.com/anomalyco/opentui/commit/6aa0228ff0a4611823343969ee1d8a7c37928fee) fix(core): adjust for graphemes width when calculating word boundaries - [`7e701fe`](https://github.com/anomalyco/opentui/commit/7e701fe208d078ac42fe59abd2aa916fb8dba354) Merge branch 'main' into word-boundary-detection-fix - [`4255bfb`](https://github.com/anomalyco/opentui/commit/4255bfbe35c841cde268306ac9c7c5fe77006390) Merge branch 'main' into word-boundary-detection-fix - [`f32b831`](https://github.com/anomalyco/opentui/commit/f32b831c324daac107b36771a84f3d398ac98244) fix(core): take break width into account when calculating boundary width - [`8db0d27`](https://github.com/anomalyco/opentui/commit/8db0d2783dfab2d405e7d9202860da7ab71b2bfb) Merge branch 'main' into word-boundary-detection-fix - [`866bf95`](https://github.com/anomalyco/opentui/commit/866bf9508f45bfaab7f5de851d78e25bca75882a) Merge branch 'main' into word-boundary-detection-fix ### 📊 Changes **6 files changed** (+225 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/edit-buffer.test.ts` (+39 -0) 📝 `packages/core/src/zig/edit-buffer.zig` (+21 -5) 📝 `packages/core/src/zig/tests/edit-buffer_test.zig` (+57 -0) 📝 `packages/core/src/zig/tests/text-buffer-view_test.zig` (+66 -0) 📝 `packages/core/src/zig/text-buffer-iterators.zig` (+38 -0) 📝 `packages/core/src/zig/text-buffer-view.zig` (+4 -13) </details> ### 📄 Description PR on issue #566 Added a helper calculating column delta and applied it to getPrevWordBoundary and getNextWordBoundary. The algorithm is basically reused from segment_callback Disclaimer: I don't really know zig and this is my first time using it :) --- <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:24 +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#623
No description provided.