Dismiss search bar on Escape in Helix normal mode#52877
Open
kai-at-pave wants to merge 1 commit intozed-industries:mainfrom
Open
Dismiss search bar on Escape in Helix normal mode#52877kai-at-pave wants to merge 1 commit intozed-industries:mainfrom
kai-at-pave wants to merge 1 commit intozed-industries:mainfrom
Conversation
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
|
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.
|
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SwitchToHelixNormalModeaction (bound to Escape) overrideseditor::Cancel, which normally propagates to dismiss the search barSwitchToHelixNormalModehandler, matching Vim mode behaviorRoot 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. Sinceeditor::Cancelnever fires, theBufferSearchBarnever receives the dismiss signal.Test Plan
test_helix_search_dismiss_on_escapetest - verifies the search bar is dismissed after pressing Escape in Helix normal modeRelease Notes