# editor: Fix APCA contrast split text runs offset \(\#38751\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 0f7dbf57f5e690780cf7b388d19fa1378e297a6e

Requested commit: 0f7dbf57f5e690780cf7b388d19fa1378e297a6e

Commit: 0f7dbf57f5e690780cf7b388d19fa1378e297a6e

Tree: b29c3597cfcd6d0e05466f1c542d41f5a205746a

Author: Smit Barmase

Committer: GitHub

## Message

```
editor: Fix APCA contrast split text runs offset (#38751)

Closes #38576

In case of inline element rendering, we can have multiple text runs on
the same display row. There was a bug in
https://github.com/zed-industries/zed/pull/37165 which doesn't consider
this multiple text runs case. This PR fixes that and adds a test for it.

Before:

<img width="600" alt="image"
src="https://github.com/user-attachments/assets/3bdf5f14-988b-45dc-bc8e-c5d61ab35a93"
/>

After:

<img width="600" alt="image"
src="https://github.com/user-attachments/assets/0e1a45ff-c521-4994-b259-3a054d89c4df"
/>

Release Notes:

- Fixed an issue where text could be incorrectly highlighted during
search when a line contained an inline color preview.
```

## Parents

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

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