Merge pull request #2881 from VSCodeVim/malformedremap

fix: handle non-string remapped key. closes #2873
This commit is contained in:
Jason Poon 2018-07-24 00:28:01 -07:00 committed by GitHub
commit 93a48b530a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,6 +19,10 @@ export class Notation {
* (e.g. <space>, <cr>, <leader>)
*/
public static NormalizeKey(key: string, leaderKey: string): string {
if (typeof key !== 'string') {
return key;
}
if (!this.isSurroundedByAngleBrackets(key) && key.length > 1) {
key = `<${key.toLocaleLowerCase()}>`;
}