From f4a7bdedf97b31020b5776bfed11d94e061eee4f Mon Sep 17 00:00:00 2001 From: Sean Kelly Date: Sun, 4 Dec 2016 19:36:19 -0800 Subject: [PATCH] initial leader fixes (#1112) --- src/actions/actions.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/actions/actions.ts b/src/actions/actions.ts index 7b49db4458d..547a925898f 100644 --- a/src/actions/actions.ts +++ b/src/actions/actions.ts @@ -64,6 +64,9 @@ let compareKeypressSequence = function (one: string[] | string[][], two: string[ if (left === "" && !containsControlKey(right)) { continue; } if (right === "" && !containsControlKey(left)) { continue; } + if (left === "" && right === Configuration.leader) { continue; } + if (right === "" && left === Configuration.leader) { continue; } + if (left !== right) { return false; } } @@ -5866,7 +5869,7 @@ abstract class BaseEasyMotionCommand extends BaseCommand { @RegisterAction class ActionEasyMotionSearchCommand extends BaseEasyMotionCommand { modes = [ModeName.Normal]; - keys = ["\\", "\\", "s", ""]; + keys = ["", "", "s", ""]; public getMatches(position: Position, vimState: VimState): EasyMotion.Match[] { const searchChar = this.keysPressed[3]; @@ -5883,7 +5886,7 @@ class ActionEasyMotionSearchCommand extends BaseEasyMotionCommand { @RegisterAction class ActionEasyMotionFindForwardCommand extends BaseEasyMotionCommand { modes = [ModeName.Normal]; - keys = ["\\", "\\", "f", ""]; + keys = ["", "", "f", ""]; public getMatches(position: Position, vimState: VimState): EasyMotion.Match[] { const searchChar = this.keysPressed[3]; @@ -5904,7 +5907,7 @@ class ActionEasyMotionFindForwardCommand extends BaseEasyMotionCommand { @RegisterAction class ActionEasyMotionFindBackwardCommand extends BaseEasyMotionCommand { modes = [ModeName.Normal]; - keys = ["\\", "\\", "F", ""]; + keys = ["", "", "F", ""]; public getMatches(position: Position, vimState: VimState): EasyMotion.Match[] { const searchChar = this.keysPressed[3]; @@ -5925,7 +5928,7 @@ class ActionEasyMotionFindBackwardCommand extends BaseEasyMotionCommand { @RegisterAction class ActionEasyMotionTilForwardCommand extends BaseEasyMotionCommand { modes = [ModeName.Normal]; - keys = ["\\", "\\", "t", ""]; + keys = ["", "", "t", ""]; public getMatches(position: Position, vimState: VimState): EasyMotion.Match[] { const searchChar = this.keysPressed[3]; @@ -5950,7 +5953,7 @@ class ActionEasyMotionTilForwardCommand extends BaseEasyMotionCommand { @RegisterAction class ActionEasyMotionTilBackwardCommand extends BaseEasyMotionCommand { modes = [ModeName.Normal]; - keys = ["\\", "\\", "T", ""]; + keys = ["", "", "T", ""]; public getMatches(position: Position, vimState: VimState): EasyMotion.Match[] { const searchChar = this.keysPressed[3]; @@ -5975,7 +5978,7 @@ class ActionEasyMotionTilBackwardCommand extends BaseEasyMotionCommand { @RegisterAction class ActionEasyMotionWordCommand extends BaseEasyMotionCommand { modes = [ModeName.Normal]; - keys = ["\\", "\\", "w"]; + keys = ["", "", "w"]; public getMatches(position: Position, vimState: VimState): EasyMotion.Match[] { // Search for the beginning of all words after the cursor @@ -5988,7 +5991,7 @@ class ActionEasyMotionWordCommand extends BaseEasyMotionCommand { @RegisterAction class ActionEasyMotionEndForwardCommand extends BaseEasyMotionCommand { modes = [ModeName.Normal]; - keys = ["\\", "\\", "e"]; + keys = ["", "", "e"]; public getMatches(position: Position, vimState: VimState): EasyMotion.Match[] { // Search for the end of all words after the cursor @@ -6005,7 +6008,7 @@ class ActionEasyMotionEndForwardCommand extends BaseEasyMotionCommand { @RegisterAction class ActionEasyMotionEndBackwardCommand extends BaseEasyMotionCommand { modes = [ModeName.Normal]; - keys = ["\\", "\\", "g", "e"]; + keys = ["", "", "g", "e"]; public getMatches(position: Position, vimState: VimState): EasyMotion.Match[] { // Search for the beginning of all words before the cursor @@ -6022,7 +6025,7 @@ class ActionEasyMotionEndBackwardCommand extends BaseEasyMotionCommand { @RegisterAction class ActionEasyMotionBeginningWordCommand extends BaseEasyMotionCommand { modes = [ModeName.Normal]; - keys = ["\\", "\\", "b"]; + keys = ["", "", "b"]; public getMatches(position: Position, vimState: VimState): EasyMotion.Match[] { // Search for the beginning of all words before the cursor