# Fix off-by-one highlighting in hover tooltip \(\#4206\) · gitcafe/zed

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

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

Visibility: public

Requested revision: ce0833eadf96d4065617a4226b3b4a228634b4a9

Requested commit: ce0833eadf96d4065617a4226b3b4a228634b4a9

Commit: ce0833eadf96d4065617a4226b3b4a228634b4a9

Tree: f95329007453ed17f10dd822cdd4a68d70bb0221

Author: Conrad Irwin

Committer: GitHub

## Message

````
Fix off-by-one highlighting in hover tooltip (#4206)

rust analyzer has a tendency to return markdown of the form:

```rust
 // <-- note the leading space
blah blah blah
```

This is clearly defectuous, so we used to .trim() the output.

Unfortunately we trim after applying syntax highlighting, so that causes
the output to look goofy.

Fix this by updating the highlighting when we trim.

[[PR Description]]

Release Notes:

- Fixed a bug where syntax highlighting was off in hover tooltips
````

## Parents

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

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

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