# Add buffer_search_deployed key context \(\#41193\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 68238479787073a2d4e4219ac06205f6d0ea7197

Requested commit: 68238479787073a2d4e4219ac06205f6d0ea7197

Commit: 68238479787073a2d4e4219ac06205f6d0ea7197

Tree: 9646c3bafb0817eb64faebb07e1990afadd83643

Author: Josh Piasecki

Committer: GitHub

## Message

```
Add buffer_search_deployed key context (#41193)

Release Notes:

- Pane key context now includes 'buffer_search_deployed' identifier

The goal of this PR is to add a new identifier in the key context that
will let the user target when the BufferSearchBar is deployed even if
they are not focused on it.

requested in #36930

Same rational as #40454 this will allow users to make more flexible
keybindings, by including some additional information higher up the key
context tree.

i thought adding this context to `Pane` seemed more appropriate than
`Editor` since `Terminal` also has a `BufferSearchBar`; however, I ran
into some import issues between BufferSearchBar, Search, Pane, and
Workspace which made it difficult to implement adding this context
directly inside `Pane`'s render function.

instead i added a new method called `contributes_context` to
`ToolbarItem` which will allow any toolbar item to add additional
context to the `Pane` level, which feels like it might come in handy.

here are some screen shots of the context being displayed in the Editor
and the Terminal

<img width="1653" height="1051" alt="Screenshot 2025-10-25 at 14 34 03"
src="https://github.com/user-attachments/assets/21c5b07a-8d36-4e0b-ad09-378b12d2ea38"
/>

<img width="1444" height="1167" alt="Screenshot 2025-10-25 at 12 32 21"
src="https://github.com/user-attachments/assets/86afe72f-b238-43cd-8230-9cb59fb93b2c"
/>
```

## Parents

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

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