Skip to content

Clip flex editor blocks to the text viewport (#56549) (cherry-pick to preview) - #56574

Merged
zed-zippy[bot] merged 1 commit into
v1.2.xfrom
cherry-pick-v1.2.x-aa9f4ede
May 12, 2026
Merged

Clip flex editor blocks to the text viewport (#56549) (cherry-pick to preview)#56574
zed-zippy[bot] merged 1 commit into
v1.2.xfrom
cherry-pick-v1.2.x-aa9f4ede

Conversation

@zed-zippy

@zed-zippy zed-zippy Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

Cherry-pick of #56549 to preview


Resolves #56518

This diff fixes code lens decorations continuing to paint into the
gutter when the editor is horizontally
scrolled. Code lens entries were rendered as flex editor blocks with
explicit gutter padding, which allowed
them to bypass the text viewport clipping used by content-only blocks.

With this change, code lens entries render as spacer-style custom blocks
instead. Spacer blocks already
scroll with buffer content and paint through the text-side mask, so the
code lens padding can be relative to
the editor text area and decorations clip at the left edge of the
viewport.

Before After
<video
src="https://github.com/user-attachments/assets/dc567ce5-ad04-4ba2-9156-ec4ec087bd41"
controls width="320"> <video
src="https://github.com/user-attachments/assets/abb5ba2c-981f-4399-903b-0f8fa9a560e4"
controls width="320">

Release Notes:

  • Fixed code lens decorations painting outside the editor viewport when
    horizontally scrolling.

Resolves #56518

This diff fixes code lens decorations continuing to paint into the
gutter when the editor is horizontally
scrolled. Code lens entries were rendered as flex editor blocks with
explicit gutter padding, which allowed
them to bypass the text viewport clipping used by content-only blocks.

With this change, code lens entries render as spacer-style custom blocks
instead. Spacer blocks already
scroll with buffer content and paint through the text-side mask, so the
code lens padding can be relative to
the editor text area and decorations clip at the left edge of the
viewport.

| Before | After |
| --- | --- |
| <video
src="https://github.com/user-attachments/assets/dc567ce5-ad04-4ba2-9156-ec4ec087bd41"
controls width="320"></video> | <video
src="https://github.com/user-attachments/assets/abb5ba2c-981f-4399-903b-0f8fa9a560e4"
controls width="320"></video> |

Release Notes:
- Fixed code lens decorations painting outside the editor viewport when
horizontally scrolling.
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label May 12, 2026
@zed-community-bot zed-community-bot Bot added the bot Pull requests authored by a bot label May 12, 2026
@zed-zippy
zed-zippy Bot merged commit 9cd2762 into v1.2.x May 12, 2026
41 checks passed
@zed-zippy
zed-zippy Bot deleted the cherry-pick-v1.2.x-aa9f4ede branch May 12, 2026 20:28
@zed-zippy zed-zippy Bot added the PR state:needs review Used to label PRs that are in need of a post-merge approval label May 13, 2026
@probably-neb

Copy link
Copy Markdown
Collaborator

@zed-zippy approve

@zed-zippy zed-zippy Bot removed the PR state:needs review Used to label PRs that are in need of a post-merge approval label May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot Pull requests authored by a bot cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants