MCPcopy
hub / github.com/VSCodeVim/Vim / parseVimRCMappings

Function parseVimRCMappings

test/testSimplifier.ts:527–552  ·  view source on GitHub ↗
(lines: string[])

Source from the content-addressed store, hash-verified

525}
526
527async function parseVimRCMappings(lines: string[]): Promise<void> {
528 const config = Globals.mockConfiguration;
529
530 // Remove all the old remappings from the .vimrc file
531 VimrcImpl.removeAllRemapsFromConfig(config);
532
533 const vscodeCommands = await vscode.commands.getCommands();
534 // Add the new remappings
535 for (const line of lines) {
536 const remap = await vimrcKeyRemappingBuilder.build(line, vscodeCommands);
537 if (remap) {
538 VimrcImpl.addRemapToConfig(config, remap);
539 continue;
540 }
541 const unremap = await vimrcKeyRemappingBuilder.buildUnmapping(line);
542 if (unremap) {
543 VimrcImpl.removeRemapFromConfig(config, unremap);
544 continue;
545 }
546 const clearRemap = await vimrcKeyRemappingBuilder.buildClearMapping(line);
547 if (clearRemap) {
548 VimrcImpl.clearRemapsFromConfig(config, clearRemap);
549 continue;
550 }
551 }
552}
553
554export type { ITestObject };

Callers 1

testItWithRemapsFunction · 0.85

Calls 7

buildMethod · 0.80
addRemapToConfigMethod · 0.80
buildUnmappingMethod · 0.80
removeRemapFromConfigMethod · 0.80
buildClearMappingMethod · 0.80
clearRemapsFromConfigMethod · 0.80

Tested by

no test coverage detected