# agent: Fix streaming edit file tool inserting newlines when old_text ends with newline \(\#52661\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 21da59dfd9de3be3535af0642766b62d55365ec9

Requested commit: 21da59dfd9de3be3535af0642766b62d55365ec9

Commit: 21da59dfd9de3be3535af0642766b62d55365ec9

Tree: dad920e48861e9b8e977bbd5dfb0c0a5e0846e12

Author: Bennet Bo Fenner

Committer: GitHub

## Message

```
agent: Fix streaming edit file tool inserting newlines when old_text ends with newline (#52661)

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
```

## Parents

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

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