# Trim diagnostic messages to fix rendering bug · gitcafe/zed

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

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

Visibility: public

Requested revision: f8939fd859fad1a5aa59aabb4b5da9ab033aa3f9

Requested commit: f8939fd859fad1a5aa59aabb4b5da9ab033aa3f9

Commit: f8939fd859fad1a5aa59aabb4b5da9ab033aa3f9

Tree: a0ae897864e46699a3b9b701d3ea801fce37a276

Author: Thorsten Ball

Committer: Thorsten Ball

## Message

```
Trim diagnostic messages to fix rendering bug

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.

Co-authored-by: Antonio <antonio@zed.dev>

```

## Parents

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

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