Paint selection and whole-line decoration backgrounds across view zones#317264
Draft
Copilot wants to merge 3 commits into
Draft
Paint selection and whole-line decoration backgrounds across view zones#317264Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Co-authored-by: dmitrivMS <9581278+dmitrivMS@users.noreply.github.com>
Co-authored-by: dmitrivMS <9581278+dmitrivMS@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve codelens and selection/decoration behaviour
Paint selection and whole-line decoration backgrounds across view zones
May 19, 2026
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.
View zones (code lens, AI-inserted region headers, etc.) sandwiched between two selected — or whole-line-decorated — lines do not pick up the surrounding background, leaving a visible gap in an otherwise contiguous band:
Changes
ViewZoneBackgrounds(src/vs/editor/browser/viewParts/viewZoneBackgrounds/)viewportData.whitespaceViewportDataand, for each whitespace whose gap between view linesafterLineNumberandafterLineNumber + 1is fully enclosed by a selection, emits acslr selected-textdiv at the whitespace's vertical offset. Same logic for anyisWholeLinedecoration with aclassName, emitting acdr <className>div — so multi-line backgrounds (e.g. AI-inserted regions) read as one band across the zone.afterLineNumber === 0(before line 1) and zero-height (hidden-area) whitespaces.view.tsbetweenviewZones.domNodeandviewLines.getDomNode(). This z-order covers empty view zones (codelens reservation) while staying under view lines and content widgets, so the codelens text — rendered as a content widget — remains on top.A gap is considered enclosed by
rangewhen: