Feat: Support localleader (#3382)#10012
Open
dheerusri324 wants to merge 1 commit into
Open
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.
What this PR does / why we need it:
This PR adds support for the
<localleader>keymap, acting analogously to the existing<leader>configuration.In Vim,
<localleader>provides a prefix key for buffer-local or filetype-local mappings (often,or\), separate from the global<leader>. Users often rely heavily on these mappings in their existing.vimrcconfigurations, and previously, they could not easily port those configurations into VSCodeVim without manual translations.This PR implements
<localleader>across the entire codebase to mirror the precise functionality of<leader>, including:vim.localleaderextension setting (\by default, same as Vim).<localleader>securely through key normalization (Notation.NormalizeKey) and execution action loops (CompareKeypressSequence)..vimrcVimscript parser so<localleader>is fully supported in user map configurations.<localleader>replacement during UI rendering (showcmdstatus).<LocalLeader>within.vimfiles.Which issue(s) this PR fixes
fixes #3382
Special notes for reviewer:
<leader>implementation structure.NormalizeKeyandprintableKeyhave updated signatures to accept an optional third argument forlocalLeaderKey.recordedState.tsgetters,localleaderdisplay replacements explicitly run beforeleaderreplacements conditionally to prevent collision clobbering when both variables default to the identical\key sequence.