[PR #788] [CLOSED] fix: set wrap width on resize for text buffer renderables #1565

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

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/788
Author: @cjroth
Created: 3/7/2026
Status: Closed

Base: mainHead: main


📝 Commits (1)

  • 7f987e3 fix: set wrap width on resize for text buffer renderables

📊 Changes

1 file changed (+3 additions, -0 deletions)

View changed files

📝 packages/core/src/renderables/TextBufferRenderable.ts (+3 -0)

📄 Description

Summary

When wrapMode is enabled ("char" or "word") and a TextBufferRenderable is resized, the wrap width was not being updated in onResize(). This caused text to retain the old wrap width after a container resize.

The fix adds the same setWrapWidth call that already exists in:

  • Initialization (afterSetup, line ~94)
  • The wrapMode setter (line ~283)

Both use the identical guard pattern: if (this._wrapMode !== "none" && width > 0).

Changes

  • packages/core/src/renderables/TextBufferRenderable.ts: Call this.textBufferView.setWrapWidth(width) in onResize() when wrap mode is active

🔄 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/788 **Author:** [@cjroth](https://github.com/cjroth) **Created:** 3/7/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`7f987e3`](https://github.com/anomalyco/opentui/commit/7f987e34ae41542c418c687ca9ac87af97b15e7f) fix: set wrap width on resize for text buffer renderables ### 📊 Changes **1 file changed** (+3 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/renderables/TextBufferRenderable.ts` (+3 -0) </details> ### 📄 Description ## Summary When `wrapMode` is enabled (`"char"` or `"word"`) and a `TextBufferRenderable` is resized, the wrap width was not being updated in `onResize()`. This caused text to retain the old wrap width after a container resize. The fix adds the same `setWrapWidth` call that already exists in: - Initialization (`afterSetup`, line ~94) - The `wrapMode` setter (line ~283) Both use the identical guard pattern: `if (this._wrapMode !== "none" && width > 0)`. ## Changes - `packages/core/src/renderables/TextBufferRenderable.ts`: Call `this.textBufferView.setWrapWidth(width)` in `onResize()` when wrap mode is active --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 09:43:34 +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#1565
No description provided.