Skip to content

Fix search bar not closing on escape in Helix keymap - #48847

Merged
kubkon merged 2 commits into
zed-industries:mainfrom
buildingvibes:fix-helix-escape-search
Apr 22, 2026
Merged

Fix search bar not closing on escape in Helix keymap#48847
kubkon merged 2 commits into
zed-industries:mainfrom
buildingvibes:fix-helix-escape-search

Conversation

@buildingvibes

@buildingvibes buildingvibes commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes an issue where pressing Escape in the search bar did not dismiss it when using the Helix keymap, while it worked correctly in Vim mode.

Root Cause

The Helix-specific escape bindings in helix_normal and helix_select modes were intercepting the escape key press before the BufferSearchBar escape binding could handle it. The Helix escape bindings had context conditions like:

  • VimControl && vim_mode == helix_normal && !menu
  • vim_mode == helix_select && !menu

These contexts did not exclude the BufferSearchBar, so they took precedence over the search bar's escape handling.

Solution

Added && !BufferSearchBar to both Helix escape binding contexts, ensuring that when the search bar is active, its escape binding takes precedence and properly dismisses the search bar. This makes the behavior consistent with Vim mode.

Test Plan

Manual Testing

  1. Enable Helix keymap mode in Zed settings
  2. Open a file with some content
  3. Press / to open the search bar
  4. Type a search query
  5. Press Escape - the search bar should now close (previously it stayed open)

Verification

  • The fix only modifies keymap context conditions, not any Rust code
  • The change aligns with the existing pattern used in Vim mode
  • No behavioral changes to any other keybindings

Fixes #47797

The escape key was not dismissing the search bar when using the Helix
keymap because the Helix-specific escape bindings in helix_normal and
helix_select modes were taking precedence over the BufferSearchBar
escape binding.

This fix adds `&& !BufferSearchBar` to the context conditions for the
Helix escape bindings, allowing the BufferSearchBar's escape binding
to take precedence when the search bar is active. This makes the
behavior consistent with Vim mode, where pressing escape in the search
bar properly dismisses it.

Fixes zed-industries#47797
@cla-bot

cla-bot Bot commented Feb 10, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @buildingvibes on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Feb 10, 2026
@buildingvibes

Copy link
Copy Markdown
Contributor Author

@cla-bot check

@cla-bot

cla-bot Bot commented Feb 10, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @buildingvibes on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@cla-bot

cla-bot Bot commented Feb 10, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@buildingvibes
buildingvibes force-pushed the fix-helix-escape-search branch from b6f0e3b to 66bd613 Compare February 10, 2026 05:37
@cla-bot

cla-bot Bot commented Feb 10, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @buildingvibes on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@buildingvibes

Copy link
Copy Markdown
Contributor Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Feb 10, 2026
@cla-bot

cla-bot Bot commented Feb 10, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@buildingvibes

Copy link
Copy Markdown
Contributor Author

@cla-bot check

@cla-bot

cla-bot Bot commented Feb 10, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@kubkon kubkon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@zed-industries-bot

Copy link
Copy Markdown
Contributor
Warnings
⚠️

This PR is missing release notes.

Please add a "Release Notes" section that describes the change:

Release Notes:

- Added/Fixed/Improved ...

If your change is not user-facing, you can use "N/A" for the entry:

Release Notes:

- N/A

Generated by 🚫 dangerJS against fb0de62

@kubkon
kubkon merged commit fa0ba05 into zed-industries:main Apr 22, 2026
31 checks passed
kathbigra pushed a commit to kathbigra/zed that referenced this pull request May 10, 2026
…48847)

Release Notes:

- Fixed an issue where pressing `Escape` in the search bar did not dismiss it when using the Helix keymap, while it worked correctly in Vim mode.

Co-authored-by: buildingvibes <buildingvibes@users.noreply.github.com>
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
…48847)

Release Notes:

- Fixed an issue where pressing `Escape` in the search bar did not dismiss it when using the Helix keymap, while it worked correctly in Vim mode.

Co-authored-by: buildingvibes <buildingvibes@users.noreply.github.com>
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
…48847)

Release Notes:

- Fixed an issue where pressing `Escape` in the search bar did not dismiss it when using the Helix keymap, while it worked correctly in Vim mode.

Co-authored-by: buildingvibes <buildingvibes@users.noreply.github.com>
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
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 first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search bar doesn't close on escape when using Helix Keymap

3 participants