changed merging behavior for picker_keymaps to prevent double assignment#155
Open
Keksmo wants to merge 1 commit into
Open
changed merging behavior for picker_keymaps to prevent double assignment#155Keksmo wants to merge 1 commit into
Keksmo wants to merge 1 commit into
Conversation
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.
Why is this fix needed?
The current implementation of the merging logic of user options and defaults makes it so that when assigning a keybind for the pickers, it does not delete the old keybind, but just assigns both. The problem with that is, that for example the search picker uses per default, which conflicts with Telescope's default navigation and can not be unbound do to the current merging logic (not even by disabling the default keybinds).
What this does
This adjusts the merging logic, so that if a keybind is set for a picker, it will only use the keybinds assigned by the user. However, it will require setting all keybinds for that picker as soon as one keybind is overwritten, because otherwise merging them would not (easily) be possible due to differing filestructures, which would require a detection for the executed command and therefore require changing the config (at least to my knowledge, i'm not that knowledgable in lua)
I do recognize that this introduces a breaking change for people who partially overwrote the picker_keymaps. However, in my opinion it is worth introducing this change, because adding the default 4 lines of config are not as big of a deal than making subfunctions of the plugin unusuable when using other plugins that require certain keybinds. Of course i'm open to other suggestions tho