[PR #720] [MERGED] utf8: fix wrap offsets at SIMD boundaries #738

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

📋 Pull Request Information

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

Base: mainHead: simd-grapheme-accounting


📝 Commits (1)

  • 769c3e6 utf8: fix wrap offsets at SIMD boundaries

📊 Changes

4 files changed (+187 additions, -3 deletions)

View changed files

📝 packages/core/src/zig/tests/text-buffer-view_test.zig (+58 -0)
📝 packages/core/src/zig/text-buffer-view.zig (+1 -0)
📝 packages/core/src/zig/utf8.zig (+3 -3)
📝 packages/solid/tests/scrollbox-content.test.tsx (+125 -0)

📄 Description

When a multibyte sequence starts near the end of a mixed SIMD block,
wrap scanning can advance past bytes it did not consume. That skews char
offsets and break points, so word wrapping may split a word across
lines.

Keep scanning aligned with processed bytes and keep grapheme state across
fast-path transitions.


🔄 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/720 **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:** `simd-grapheme-accounting` --- ### 📝 Commits (1) - [`769c3e6`](https://github.com/anomalyco/opentui/commit/769c3e6fc2bdd75798048bceebdb92309336a037) utf8: fix wrap offsets at SIMD boundaries ### 📊 Changes **4 files changed** (+187 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/zig/tests/text-buffer-view_test.zig` (+58 -0) 📝 `packages/core/src/zig/text-buffer-view.zig` (+1 -0) 📝 `packages/core/src/zig/utf8.zig` (+3 -3) 📝 `packages/solid/tests/scrollbox-content.test.tsx` (+125 -0) </details> ### 📄 Description When a multibyte sequence starts near the end of a mixed SIMD block, wrap scanning can advance past bytes it did not consume. That skews char offsets and break points, so word wrapping may split a word across lines. Keep scanning aligned with processed bytes and keep grapheme state across fast-path transitions. --- <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:54 +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#738
No description provided.