fix(terminal): stop keyword highlight flicker on Enter - #2805
Conversation
Idle Enter was misclassified as user scroll so overscan decorations were pruned before writeParsed cancel (Ubuntu RTT). Also swap cursor-line decorations atomically to avoid clear-before-create flash (fixes #2784). Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
While enterInputPending blocked scroll-prune, viewport scrolls were also ignored with no dirty mark. Mark dirty during the window and trigger a write refresh when Enter protection clears. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Replace Enter scroll-skip band-aid with mam15mon/#2348 persistence: keep decorations across scroll, sync only newly exposed rows, bound retention (~20 viewports / max 1200). Keep Enter write-path protections and cursor-line atomic swap. Continuous Enter may scroll; prune-on-scroll is gone. Co-authored-by: mam15mon <mam15mon@users.noreply.github.com> Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Keep Enter/write deferred pruning intact by pruning the retention cap only after scroll viewport indexing, not on every decoration apply. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Overlapping scroll only scanned newly exposed rows then cleared the whole viewport dirty set, which could drop in-place redraw work when scroll outranked a pending write refresh. Rescan write-dirtied overlap lines and only clear dirty for ranges that were actually processed. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Summary
With keyword highlighting enabled, pressing Enter (which scrolls the terminal) could flash existing highlights. The earlier approach special-cased Enter to skip scroll pruning; that fights real scrolling and is the wrong model.
This PR ports the architecture from community PR #2348 (mam15mon): persist nearby keyword decorations across scroll, scan only newly exposed rows, and bound retention so broad rules cannot grow unbounded. Continuously pressing Enter is treated as real scroll. Also keeps an atomic cursor-line decoration swap so current-line + delimiter highlights do not clear-before-create flash.
Type of Change
Related Issue (optional)
Closes #2784
Related to #2348
Changes Made
processScrollViewportfor newly exposed rows (immediate scroll refresh)xtermPerformance.ts)Screenshots / Demo
N/A (terminal highlight stability while scrolling / pressing Enter)
Testing
npm run dev)npm run lint)npm test) — keywordHighlight + cursorLineHighlight (61)npm run generate:capability-tools)Checklist
Performance notes