Skip to content

Commit

Permalink
Remove test hack
Browse files Browse the repository at this point in the history
  • Loading branch information
jpoon committed Aug 31, 2016
1 parent e0449ae commit fe4cc8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/mode/modeHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,16 +625,8 @@ export class ModeHandler implements vscode.Disposable {
}

async handleKeyEvent(key: string): Promise<Boolean> {
if (key === "<c-r>") { key = "ctrl+r"; } // TODO - temporary hack for tests only!
if (key === "<c-a>") { key = "ctrl+a"; } // TODO - temporary hack for tests only!
if (key === "<c-x>") { key = "ctrl+x"; } // TODO - temporary hack for tests only!

if (key === "<esc>") { key = "<escape>"; }

// Due to a limitation in Electron, en-US QWERTY char codes are used in international keyboards.
// We'll try to mitigate this problem until it's fixed upstream.
// https://github.com/Microsoft/vscode/issues/713

this._vimState.cursorPositionJustBeforeAnythingHappened = this._vimState.cursorPosition;

try {
Expand Down
10 changes: 10 additions & 0 deletions test/testSimplifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ function tokenizeKeySequence(sequence: string): string[] {
continue;
}

const bracketedKeyTranslations = {
'<c-r>' : 'ctrl+r',
'<c-a>' : 'ctrl+a',
'<c-x>' : 'ctrl+x',
};

if (key in bracketedKeyTranslations) {
key = bracketedKeyTranslations[key];
}

result.push(key);
key = "";
}
Expand Down

0 comments on commit fe4cc8f

Please sign in to comment.