You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 .vimrc configurations, 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:
Exposing the vim.localleader extension setting (\ by default, same as Vim).
Resolving <localleader> securely through key normalization (Notation.NormalizeKey) and execution action loops (CompareKeypressSequence).
Integrating with the .vimrc Vimscript parser so <localleader> is fully supported in user map configurations.
Accurately processing <localleader> replacement during UI rendering (showcmd status).
Enabling TextMate syntax highlighting for <LocalLeader> within .vim files.
All changes strictly adhere to the pre-existing <leader> implementation structure. NormalizeKey and printableKey have updated signatures to accept an optional third argument for localLeaderKey.
Inside recordedState.ts getters, localleader display replacements explicitly run beforeleader replacements conditionally to prevent collision clobbering when both variables default to the identical \ key sequence.
Tested the integration locally in both normal user configuration bounds and custom remapping contexts to verify functionality.
Hi @J-Fields, it should be good to go now!
I pulled down the recent merges from master and fixed the resulting build errors. I added the missing localleader property to the testConfiguration.ts mock so the interface matches, and I also went ahead and patched the glob v11 API update in test/index.ts that was causing the CI to fail on the master merge.
The local build, lint, and tests are all passing!
Hi @J-Fields,
First, I want to sincerely apologize for all the back-and-forth on this, and thank you again for your patience and guidance!
I finally tracked down the CI issue. It turns out the test environment actually pulls in glob v7 transitively, rather than v11.
Because v7 doesn't return a Promise, my async approach was failing the updated, stricter ESLint rules. I've reverted the test runner to use the v7 callback API, which fully resolved the type errors.
To be absolutely sure before pinging you again, I set up a test PR on my own fork and confirmed that the ubuntu-latest build now passes completely green. This is ready for another look whenever you have the time. Thanks again!
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
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.