mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 04:55:58 +03:00
[PR #634] [MERGED] fix(editor-view): clear stale glyphs when text shrinks #675
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#675
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/anomalyco/opentui/pull/634
Author: @kitlangton
Created: 2/5/2026
Status: ✅ Merged
Merged: 2/6/2026
Merged by: @kommander
Base:
main← Head:fix/placeholder-ghosting📝 Commits (1)
99890abfix(editor-view): mark virtual lines dirty when placeholder text changes📊 Changes
2 files changed (+76 additions, -4 deletions)
View changed files
📝
packages/core/src/zig/editor-view.zig(+4 -0)📝
packages/core/src/zig/tests/editor-view_test.zig(+72 -4)📄 Description
Closes https://github.com/anomalyco/opentui/issues/635 (reiterated below)
I was adding mode-specific placeholder text in
opencode, such that shell mode shows a relevant bash example rather than the normal prompt example.That exposed a rendering bug in OpenTUI: when switching from the longer normal-mode placeholder to the shorter shell-mode placeholder, trailing characters from the old placeholder stayed visible. Example:
1. Build mode placeholder (all good)

2. When switching to bash mode (OH NO! DEAR GOD NO!)

As you can see, the last bits of
"Fix broken tests"aren't cleared as one might expect, leaving us with the hideous:Run a command... "pwd"roken testsThe Cause
Two things combined:
EditorViewplaceholder updates while placeholder is active did not always force virtual line recomputation.The Fix
packages/core/src/zig/editor-view.zigRegression Coverage
packages/core/src/zig/tests/editor-view_test.zigEditorView - placeholder long to short clears tail without full buffer clearEditorView - placeholder clear preserves existing backgroundThese tests fail without the full fix and pass with it.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.