You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When streaming content into a CodeRenderable and newer chunks arrive faster than the async highlighter can finish, the display may stall indefinitely if the renderer is otherwise idle (no animations, no input events). The stale highlight never gets re-attempted until an external requestRender() call occurs.
Root Cause
In CodeRenderable.startHighlight(), multiple snapshot-ID checks abort the method when a newer content chunk has arrived while highlighting was in-flight:
There are four such early returns (after highlightOnce, after onHighlight, after transformChunks, and in the catch block). On abort, the method returns without calling requestRender(). Since the preceding renderSelf() already cleared _highlightsDirty = false, and the aborted highlight doesn't reschedule, no new frame is queued. The next pending highlight is never started until something else externally triggers rendering.
Proposed Fix
Call this.requestRender() before each snapshot-mismatch early return inside startHighlight() so that the next frame can detect the still-dirty state and kick off the pending highlight.
Test Request
A test should verify that resolving a stale highlight (snapshot mismatch) still results in a subsequent requestRender() and a new highlight request.
Activity
simonklee commentedon Apr 22, 2026
Thanks. Ill have s look
viralcodex commentedon May 5, 2026
Hi @altendky, can you tell me if you found a way to reproduce this? If yes, would love to know
fix(renderable): ensure rendering is requested after highlight updates (
altendky commentedon May 5, 2026
thanks!