Skip to content

editor: Clip flex editor blocks to the text viewport - #56549

Merged
SomeoneToIgnore merged 1 commit into
zed-industries:mainfrom
terror:code-lense-sticky
May 12, 2026
Merged

editor: Clip flex editor blocks to the text viewport#56549
SomeoneToIgnore merged 1 commit into
zed-industries:mainfrom
terror:code-lense-sticky

Conversation

@terror

@terror terror commented May 12, 2026

Copy link
Copy Markdown
Contributor

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
Screen.Recording.2026-05-12.at.11.43.10.AM.mov
Screen.Recording.2026-05-12.at.11.39.47.AM.mov

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
@ChristopherBiscardi ChristopherBiscardi added the area:editor Feedback for code editing, formatting, editor iterations, etc label May 12, 2026
@SomeoneToIgnore SomeoneToIgnore self-assigned this May 12, 2026

@SomeoneToIgnore SomeoneToIgnore left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, thank you!

@SomeoneToIgnore
SomeoneToIgnore added this pull request to the merge queue May 12, 2026
Merged via the queue into zed-industries:main with commit aa9f4ed May 12, 2026
45 checks passed
@SomeoneToIgnore

Copy link
Copy Markdown
Contributor

/cherry-pick preview
/cherry-pick stable

zed-zippy Bot added a commit that referenced this pull request May 12, 2026
… preview) (#56574)

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> | <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.

Co-authored-by: liam <liam@scalzulli.com>
zed-zippy Bot added a commit that referenced this pull request May 12, 2026
… stable) (#56575)

Cherry-pick of #56549 to stable

----
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.

Co-authored-by: liam <liam@scalzulli.com>
@terror terror changed the title Clip flex editor blocks to the text viewport editor: Clip flex editor blocks to the text viewport May 23, 2026
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
Resolves zed-industries#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.
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
Resolves zed-industries#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:editor Feedback for code editing, formatting, editor iterations, etc cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code lens decorations don’t clip to editor viewport on horizontal scroll

3 participants