# picker: Give delegate the initial preview layout \(\#60007\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 2b0a83ea817d8fd046a3fe4ef92b229e442ab8c6

Requested commit: 2b0a83ea817d8fd046a3fe4ef92b229e442ab8c6

Commit: 2b0a83ea817d8fd046a3fe4ef92b229e442ab8c6

Tree: de6707fab946001f77c5e9e4349c40a9cb8c6b5c

Author: guopenghui

Committer: GitHub

## Message

```
picker: Give delegate the initial preview layout (#60007)

## Objective

- Provide initial preview layout information for the picker delegate.
This ensures that when match items with different styles need to be
displayed under horizontal or vertical layouts, they render correctly on
the first display.

## Solution

- Pass the initial layout information to the delegate in the picker
constructor


## 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

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

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