# Fix picker preview for matches far down in files \(\#59621\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 3df8983debfa74eeece743385330a64b2c8ad5d4

Requested commit: 3df8983debfa74eeece743385330a64b2c8ad5d4

Commit: 3df8983debfa74eeece743385330a64b2c8ad5d4

Tree: 3ff277457d02b9e1863063542e7b17285f1030a4

Author: Anthony Eid

Committer: GitHub

## Message

```
Fix picker preview for matches far down in files (#59621)

Fixes picker previews for matches far down in a file by building the
excerpt around the actual matched row instead of clamping it to the
preview height estimate.

### Before

<img width="1858" height="1192" alt="Screenshot 2026-06-19 at 6 03
03 PM"
src="https://github.com/user-attachments/assets/fcbed7c4-22d6-4481-a263-522bb48c656f"
/>

### After

<img width="2057" height="1128" alt="Screenshot 2026-06-19 at 6 05
02 PM"
src="https://github.com/user-attachments/assets/f88db8e2-8687-4f79-8085-bca50de09ce9"
/>

## 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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
```

## Parents

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

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