Skip to content

Dismiss search bar on Escape in Helix normal mode#52877

Open
kai-at-pave wants to merge 1 commit intozed-industries:mainfrom
kai-at-pave:fix/helix-escape-dismiss-search
Open

Dismiss search bar on Escape in Helix normal mode#52877
kai-at-pave wants to merge 1 commit intozed-industries:mainfrom
kai-at-pave:fix/helix-escape-dismiss-search

Conversation

@kai-at-pave
Copy link
Copy Markdown

Summary

  • Fixes the search bar not closing on Escape when using Helix keymap (Search bar doesn't close on escape when using Helix Keymap #47797)
  • In Helix mode, the SwitchToHelixNormalMode action (bound to Escape) overrides editor::Cancel, which normally propagates to dismiss the search bar
  • The fix adds search bar dismissal logic to the SwitchToHelixNormalMode handler, matching Vim mode behavior

Root Cause

The Helix-specific escape binding (VimControl && vim_mode == helix_normal && !menu -> vim::SwitchToHelixNormalMode) is more specific than the shared binding ((vim_mode == normal || vim_mode == helix_normal) && !menu -> editor::Cancel), so it takes precedence. Since editor::Cancel never fires, the BufferSearchBar never receives the dismiss signal.

Test Plan

Release Notes

In Helix mode, pressing Escape while the search bar is open does not
dismiss it, unlike Vim mode. This happens because the Helix-specific
escape binding (vim::SwitchToHelixNormalMode) overrides the
editor::Cancel binding that normally propagates to dismiss the search
bar.

Fix by having SwitchToHelixNormalMode also dismiss the buffer search
bar when it is open, matching the behavior users expect from both Vim
mode and the Helix editor itself.

Closes zed-industries#47797
@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Apr 1, 2026

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: kai-at-pave.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@zed-codeowner-coordinator zed-codeowner-coordinator bot requested review from a team, Veykril and dinocosta and removed request for a team April 1, 2026 05:42
@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 Apr 1, 2026
@MrSubidubi MrSubidubi requested a review from kubkon April 1, 2026 08:07
@MrSubidubi MrSubidubi changed the title fix: dismiss search bar on Escape in Helix normal mode Dismiss search bar on Escape in Helix normal mode Apr 1, 2026
@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 c3edfe6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

4 participants