fix(editor-view): clear stale glyphs when text shrinks#634
Merged
kommander merged 1 commit intoanomalyco:mainfrom Feb 6, 2026
Merged
fix(editor-view): clear stale glyphs when text shrinks#634kommander merged 1 commit intoanomalyco:mainfrom
kommander merged 1 commit intoanomalyco:mainfrom
Conversation
20b9f04 to
7216e91
Compare
2506259 to
5948d05
Compare
When placeholder text was replaced while a placeholder was already active, virtual lines were not recalculated. The view_id is registered with the original buffer, not the placeholder, so the standard dirty- flag mechanism does not detect this change. This caused stale glyphs from the previous longer placeholder to remain visible.
5948d05 to
99890ab
Compare
@opentui/core
@opentui/react
@opentui/solid
@opentui/core-darwin-arm64
@opentui/core-darwin-x64
@opentui/core-linux-arm64
@opentui/core-linux-x64
@opentui/core-win32-arm64
@opentui/core-win32-x64
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #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.