# agent: Do not render unnecessary lines in edit file tool card \(\#29766\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 92b9ecd7d297b3ded8ca9e645312a414ca32173b

Requested commit: 92b9ecd7d297b3ded8ca9e645312a414ca32173b

Commit: 92b9ecd7d297b3ded8ca9e645312a414ca32173b

Tree: c37bfb98bca1ddf35f135a68d076514df602ad9f

Author: Finn Evers

Committer: GitHub

## Message

```
agent: Do not render unnecessary lines in edit file tool card (#29766)

This PR prevents any unnecessary lines from being rendered in the edit
file tool card in the case of small diffs.

I think this (hopefully) addresses the last remaining task from
https://github.com/zed-industries/zed/pull/29448.

| `main` | This PR |
| --- | --- |
| <img width="634" alt="main"
src="https://github.com/user-attachments/assets/7c06394e-957a-4d36-a484-5974687041e9"
/> | <img width="634" alt="PR"
src="https://github.com/user-attachments/assets/84206d5a-a93a-4a42-99ca-7cdebb0d91bb"
/> |

(The last empty line in the second image is an empty line present in the
file itself)

---

n the second commit I also preemtively disabled vertical overscrolling
for full mode editors which are sized by content. This is basically the
same fix as in https://github.com/zed-industries/zed/pull/28471.
Strictly speaking, this is not needed for the fix here, but I thought it
might be nice to have for the future to prevent any issues from occuring
due to overscroll.

Release Notes:

- agent: Improved rendering of small diffs for the edit file tool card.
```

## Parents

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

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