[PR #658] fix(text-buffer): recalculate rope segment widths on tab width change #1474

Open
opened 2026-03-14 09:38:43 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/658
Author: @simonklee
Created: 2/9/2026
Status: 🔄 Open

Base: mainHead: set-tab-width-rebuild


📝 Commits (2)

  • 955a6c2 fix(text-buffer): recalculate rope segment widths on tab width change
  • d496e11 fix compile errors

📊 Changes

2 files changed (+74 additions, -0 deletions)

View changed files

📝 packages/core/src/zig/tests/text-buffer_test.zig (+20 -0)
📝 packages/core/src/zig/text-buffer.zig (+54 -0)

📄 Description

When tab width changes, rebuild rope segments with recomputed chunk widths before updating tab_width so line metrics and total width stay consistent.


🔄 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/658 **Author:** [@simonklee](https://github.com/simonklee) **Created:** 2/9/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `set-tab-width-rebuild` --- ### 📝 Commits (2) - [`955a6c2`](https://github.com/anomalyco/opentui/commit/955a6c2b145f02773bbd8d0b2f401b072c61e33c) fix(text-buffer): recalculate rope segment widths on tab width change - [`d496e11`](https://github.com/anomalyco/opentui/commit/d496e11e9981396d038c7b92dd9a798c5fd96ca0) fix compile errors ### 📊 Changes **2 files changed** (+74 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/zig/tests/text-buffer_test.zig` (+20 -0) 📝 `packages/core/src/zig/text-buffer.zig` (+54 -0) </details> ### 📄 Description When tab width changes, rebuild rope segments with recomputed chunk widths before updating tab_width so line metrics and total width stay consistent. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#1474
No description provided.