Skip to content

Conversation

@FloppyDisco
Copy link
Contributor

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

Screenshot 2025-10-25 at 14 34 03 Screenshot 2025-10-25 at 12 32 21

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Oct 25, 2025
@ConradIrwin ConradIrwin merged commit 6823847 into zed-industries:main Oct 28, 2025
22 checks passed
@ConradIrwin
Copy link
Member

nice, thank you!

tomatitito pushed a commit to tomatitito/zed that referenced this pull request Nov 7, 2025
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 zed-industries#36930

Same rational as zed-industries#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"
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants