From 5cc821e240fb3240800e9e658426b574878d10b4 Mon Sep 17 00:00:00 2001 From: Jason Poon Date: Fri, 5 Jan 2018 00:05:23 -0800 Subject: [PATCH] fix: closes #2162. handlekeys config trumps usectrlkeys config --- src/configuration/configuration.ts | 9 +++++---- src/mode/modeHandler.ts | 5 ----- 2 files changed, 5 insertions(+), 9 deletions(-) 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',