From 2ddca2881023f5ca045095929ff232d0fdbf6c19 Mon Sep 17 00:00:00 2001 From: Jamie Moreland Date: Mon, 6 May 2019 03:42:09 +0100 Subject: [PATCH] Keymapping bindings inconsistently cased #3012 (#3731) * Add keybinding regex for normalizing * Replace changed inputs with capitalized equivalents --- src/actions/commands/actions.ts | 6 +++--- src/actions/motion.ts | 4 ++-- src/configuration/notation.ts | 3 +++ test/configuration/notation.test.ts | 3 +++ test/mode/modeInsert.test.ts | 2 +- test/mode/modeReplace.test.ts | 4 ++-- test/mode/normalModeTests/motions.test.ts | 4 ++-- 7 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/actions/commands/actions.ts b/src/actions/commands/actions.ts index 1c98aed28fa..08cef766bfc 100644 --- a/src/actions/commands/actions.ts +++ b/src/actions/commands/actions.ts @@ -589,7 +589,7 @@ class CommandEscReplaceMode extends BaseCommand { @RegisterAction class CommandInsertReplaceMode extends BaseCommand { modes = [ModeName.Replace]; - keys = ['']; + keys = ['']; public async exec(position: Position, vimState: VimState): Promise { await vimState.setCurrentMode(ModeName.Insert); @@ -749,7 +749,7 @@ class CommandMoveHalfPageUp extends CommandEditorScroll { @RegisterAction export class CommandInsertAtCursor extends BaseCommand { modes = [ModeName.Normal]; - keys = [['i'], ['']]; + keys = [['i'], ['']]; public async exec(position: Position, vimState: VimState): Promise { await vimState.setCurrentMode(ModeName.Insert); @@ -792,7 +792,7 @@ class CommandReplaceAtCursorFromNormalMode extends BaseCommand { @RegisterAction class CommandReplaceAtCursorFromInsertMode extends BaseCommand { modes = [ModeName.Insert]; - keys = ['']; + keys = ['']; public async exec(position: Position, vimState: VimState): Promise { let timesToRepeat = vimState.recordedState.count || 1; diff --git a/src/actions/motion.ts b/src/actions/motion.ts index 8867fe22da5..f6cbae911e4 100644 --- a/src/actions/motion.ts +++ b/src/actions/motion.ts @@ -815,7 +815,7 @@ class MoveRepeatReversed extends BaseMovement { @RegisterAction class MoveLineEnd extends BaseMovement { - keys = [['$'], [''], ['']]; + keys = [['$'], [''], ['']]; setsDesiredColumnToEOL = true; public async execActionWithCount( @@ -829,7 +829,7 @@ class MoveLineEnd extends BaseMovement { @RegisterAction class MoveLineBegin extends BaseMovement { - keys = [['0'], [''], ['']]; + keys = [['0'], [''], ['']]; public async execAction(position: Position, vimState: VimState): Promise { return position.getLineBegin(); diff --git a/src/configuration/notation.ts b/src/configuration/notation.ts index df2505ab662..0ab7ea7a36c 100644 --- a/src/configuration/notation.ts +++ b/src/configuration/notation.ts @@ -8,6 +8,9 @@ export class Notation { Esc: ['escape', 'esc'], BS: ['backspace', 'bs'], Del: ['delete', 'del'], + Home: ['home'], + End: ['end'], + Insert: ['insert'], ' ': [''], '\n': ['', ''], }; diff --git a/test/configuration/notation.test.ts b/test/configuration/notation.test.ts index 542b486fef5..de321513344 100644 --- a/test/configuration/notation.test.ts +++ b/test/configuration/notation.test.ts @@ -12,6 +12,9 @@ suite('Notation', () => { 'c-z': '', '': '', eScapE: '', + hOme: '', + inSert: '', + eNd: '', '': '//', LEaDer: '//', '': '\n', diff --git a/test/mode/modeInsert.test.ts b/test/mode/modeInsert.test.ts index bfc51200f0d..ca30bc44b7b 100644 --- a/test/mode/modeInsert.test.ts +++ b/test/mode/modeInsert.test.ts @@ -25,7 +25,7 @@ suite('Mode Insert', () => { teardown(cleanUpWorkspace); test('can be activated', async () => { - let activationKeys = ['o', 'I', 'i', 'O', 'a', 'A', '']; + let activationKeys = ['o', 'I', 'i', 'O', 'a', 'A', '']; for (let key of activationKeys) { await modeHandler.handleKeyEvent(''); diff --git a/test/mode/modeReplace.test.ts b/test/mode/modeReplace.test.ts index 6e93d9c4fc5..4dd87159b40 100644 --- a/test/mode/modeReplace.test.ts +++ b/test/mode/modeReplace.test.ts @@ -12,9 +12,9 @@ suite('Mode Replace', () => { teardown(cleanUpWorkspace); newTest({ - title: 'Can activate with from Insert mode', + title: 'Can activate with from Insert mode', start: ['|'], - keysPressed: 'ia', + keysPressed: 'ia', end: ['a|'], endMode: ModeName.Replace, }); diff --git a/test/mode/normalModeTests/motions.test.ts b/test/mode/normalModeTests/motions.test.ts index da8d5d1135b..5f2f2afe075 100644 --- a/test/mode/normalModeTests/motions.test.ts +++ b/test/mode/normalModeTests/motions.test.ts @@ -187,9 +187,9 @@ suite('Motions in Normal Mode', () => { }); newTest({ - title: 'Can handle with a count', + title: 'Can handle with a count', start: ['te|xt text', 'text', 'text text text'], - keysPressed: '3', + keysPressed: '3', end: ['text text', 'text', 'text text tex|t'], });