[PR #677] [MERGED] fix(buffer): make grapheme span clear ID-aware in set() #705

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

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/677
Author: @simonklee
Created: 2/12/2026
Status: Merged
Merged: 2/12/2026
Merged by: @simonklee

Base: mainHead: fix-grapheme-clear


📝 Commits (1)

  • 0da5cde fix(buffer): make grapheme span clear ID-aware in set()

📊 Changes

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

View changed files

📝 packages/core/src/zig/buffer.zig (+8 -5)
📝 packages/core/src/zig/tests/buffer_test.zig (+44 -0)

📄 Description

When we update currentRenderBuffer in place, set() can clear an existing grapheme span before writing new data. The old clearing logic wiped the whole computed span blindly. In one update order, that could erase a continuation cell that had just been written for a neighboring grapheme earlier in the same pass.

When that happesn you have a grapheme start cell present, but continuation missing.
This will then cause writeResolvedChars() to write an extra normal space where the continuation should have been skipped.


🔄 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/677 **Author:** [@simonklee](https://github.com/simonklee) **Created:** 2/12/2026 **Status:** ✅ Merged **Merged:** 2/12/2026 **Merged by:** [@simonklee](https://github.com/simonklee) **Base:** `main` ← **Head:** `fix-grapheme-clear` --- ### 📝 Commits (1) - [`0da5cde`](https://github.com/anomalyco/opentui/commit/0da5cde2bcd2fb15f936d89f37789571c38c291e) fix(buffer): make grapheme span clear ID-aware in set() ### 📊 Changes **2 files changed** (+52 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/zig/buffer.zig` (+8 -5) 📝 `packages/core/src/zig/tests/buffer_test.zig` (+44 -0) </details> ### 📄 Description When we update currentRenderBuffer in place, set() can clear an existing grapheme span before writing new data. The old clearing logic wiped the whole computed span blindly. In one update order, that could erase a continuation cell that had just been written for a neighboring grapheme earlier in the same pass. When that happesn you have a grapheme start cell present, but continuation missing. This will then cause writeResolvedChars() to write an extra normal space where the continuation should have been skipped. --- <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:45 +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#705
No description provided.