# Clip flex editor blocks to the text viewport \(\#56549\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/aa9f4ede6c720bbeea29cbf601eb77de6b458466)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: aa9f4ede6c720bbeea29cbf601eb77de6b458466

Requested commit: aa9f4ede6c720bbeea29cbf601eb77de6b458466

Commit: aa9f4ede6c720bbeea29cbf601eb77de6b458466

Tree: 327d7740cfc262a43db38ff0fdaeed4a7bbdadc3

Author: liam

Committer: GitHub

## Message

```
Clip flex editor blocks to the text viewport (#56549)

Resolves https://github.com/zed-industries/zed/issues/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.
```

## Parents

- [54188321be129088de310855bc5e3b150a37530b](https://git.cafe/gitcafe/zed/commit/54188321be129088de310855bc5e3b150a37530b?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/aa9f4ede6c720bbeea29cbf601eb77de6b458466?format=markdown)
