Fix search bar not closing on escape in Helix keymap - #48847
Conversation
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
|
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 check |
|
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'. |
|
The cla-bot has been summoned, and re-checked this pull request! |
b6f0e3b to
66bd613
Compare
|
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 check |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
…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>
…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>
…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>
Summary
Fixes an issue where pressing
Escapein 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_normalandhelix_selectmodes were intercepting the escape key press before theBufferSearchBarescape binding could handle it. The Helix escape bindings had context conditions like:VimControl && vim_mode == helix_normal && !menuvim_mode == helix_select && !menuThese contexts did not exclude the
BufferSearchBar, so they took precedence over the search bar's escape handling.Solution
Added
&& !BufferSearchBarto 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
/to open the search barEscape- the search bar should now close (previously it stayed open)Verification
Fixes #47797