diff --git a/src/configuration/configuration.ts b/src/configuration/configuration.ts index bfd01505faf..b5924d1c943 100644 --- a/src/configuration/configuration.ts +++ b/src/configuration/configuration.ts @@ -74,9 +74,10 @@ class ConfigurationClass { // By default, all key combinations are used let useKey = true; - if (this.handleKeys[bracketedKey] === false) { - // disabled through `vim.handleKeys` - useKey = false; + let handleKey = this.handleKeys[bracketedKey]; + if (handleKey !== undefined) { + // enabled/disabled through `vim.handleKeys` + useKey = handleKey; } else if (!this.useCtrlKeys && bracketedKey.slice(1, 3) === 'C-') { // user has disabled CtrlKeys and the current key is a CtrlKey // , still needs to be captured to overrideCopy @@ -87,7 +88,7 @@ class ConfigurationClass { } } - vscode.commands.executeCommand('setContext', 'vim.use' + bracketedKey, useKey); + vscode.commands.executeCommand('setContext', `vim.use${bracketedKey}`, useKey); } } diff --git a/src/mode/modeHandler.ts b/src/mode/modeHandler.ts index 6d820ef7d24..17c548e68a5 100644 --- a/src/mode/modeHandler.ts +++ b/src/mode/modeHandler.ts @@ -1362,11 +1362,6 @@ export class ModeHandler implements vscode.Disposable { } this._renderStatusBar(); - await vscode.commands.executeCommand( - 'setContext', - 'vim.useCtrlKeys', - Configuration.useCtrlKeys - ); await vscode.commands.executeCommand( 'setContext', 'vim.overrideCopy',