fix(keybinds): ensure localleader sub-key is a prefix in leader map#8659
Open
kovan wants to merge 1 commit into
Open
fix(keybinds): ensure localleader sub-key is a prefix in leader map#8659kovan wants to merge 1 commit into
kovan wants to merge 1 commit into
Conversation
When `doom-localleader-key' is a sub-key of `doom-leader-key' (e.g. "S m" under "S"), intermediate minor-mode keymaps like evil-snipe can bind the leader key to a command, blocking Emacs' prefix key merging. Localleader bindings in mode aux keymaps become unreachable even though which-key displays them. Create a sparse keymap prefix for the sub-key in `doom-leader-map' so the lookup always succeeds through the leader path. Fix: doomemacs#8562 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
49194bd to
6bc236e
Compare
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
doom-localleader-keyis a sub-key ofdoom-leader-key(e.g."S m"under"S"), pressing the localleader sequence shows "undefined" even though which-key displays the entrySas a command in a minor-mode keymap that sits between the intercept keymap (leader) and mode aux keymaps (localleader). This blocks Emacs' prefix key merging — localleader bindings are never reached throughread-key-sequencedoom-init-leader-keys-h, when localleader is a sub-key of leader, create a sparse keymap prefix for the sub-key (e.g."m") indoom-leader-map. This ensures the lookup pathS→doom-leader-map→m→ mode aux keymaps always worksFix: #8562
Test plan
doom-leader-keyto"S"anddoom-localleader-keyto"S m"S— which-key should showm : +<localleader>m— localleader bindings should appear (not "S m is undefined")SPC/SPC m) still works normally🤖 Generated with Claude Code