Allow rebinding the confirm key for search and prompt inputs#5642
Open
mokashang wants to merge 1 commit into
Open
Allow rebinding the confirm key for search and prompt inputs#5642mokashang wants to merge 1 commit into
mokashang wants to merge 1 commit into
Conversation
The confirm action for the search/filter prompt and for text input prompts (e.g. naming a stash or a new branch) was hard-coded to <enter> in jesseduffield#4860, on the assumption that these wouldn't be remapped. That assumption turned out to be wrong: users who rebind universal.confirm to a key such as <c-j> could no longer confirm these two prompts. Add ConfirmSearch and ConfirmPrompt keybindings, following the existing pattern of context-specific confirm keys (confirmMenu, confirmSuggestion, confirmInEditor). Both default to <enter>, so behaviour is unchanged for users who don't remap them. Fixes jesseduffield#5510
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.
PR Description
The confirm action for the search/filter prompt and for text input prompts (e.g. when naming a stash or creating a new branch) was hard-coded to
<enter>in #4860, on the assumption that nobody would want to remap it. As reported in #5510, that assumption was wrong: users who rebindkeybinding.universal.confirmto something like<c-j>could no longer confirm those two prompts at all.This adds two new keybindings,
confirmSearchandconfirmPrompt, following the existing convention of context-specific confirm keys (confirmMenu,confirmSuggestion,confirmInEditor). Both default to<enter>, so the behaviour is completely unchanged for users who don't remap them; users who do can now point them at whatever key they like.Fixes #5510.
Testing: added an integration test (
config/rebind_confirm_search_and_prompt) that rebinds both keys to<c-y>and verifies that a search and a text prompt can each be confirmed with the rebound key. I confirmed the test fails onmaster(both prompts ignore the rebound key) and passes with this change. The existing search/prompt integration tests still pass.Please check if the PR fulfills these requirements
go generate ./...)Confirmlabel)resetKeybindingson config reload, same as the other confirm keys)