# Trim diagnostic messages to fix rendering bug \(\#4210\) · gitcafe/zed

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

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

Visibility: public

Requested revision: fc7458d13be603061af59b75efcda04e13972cb3

Requested commit: fc7458d13be603061af59b75efcda04e13972cb3

Commit: fc7458d13be603061af59b75efcda04e13972cb3

Tree: 499901edd6d5ab877e883a42062e66a270e9b1c0

Author: Thorsten Ball

Committer: GitHub

## Message

```
Trim diagnostic messages to fix rendering bug (#4210)

Before this change a diagnostic message with a trailing newline (e.g.
`line1\nline2\n`) would be rendered in a `Block` with `line_height: 2`.
But the content we then display in this block had 3 "lines", which
pushed the content out of the block.

This fixes the issue by trimming the newlines at the end from the
diagnostics.

Release Notes:

- Fixed rendering multi-line diagnostic errors inside of the editor.
```

## Parents

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

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

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