Merge branch 'master' into v2

This commit is contained in:
CHaBou 2017-09-17 23:08:33 +02:00
commit f8c19b0ef2
No known key found for this signature in database
GPG key ID: EF8D073B729A0B33
5 changed files with 21 additions and 71 deletions

View file

@ -1,27 +0,0 @@
const {getKeymaps} = require('../config/keymaps');
const normalize = keybinding => {
function sortAlphabetically(a, b) {
return a.localeCompare(b);
}
return keybinding
.toLowerCase()
.split('+')
.sort(sortAlphabetically)
.join('+');
};
const findCommandByKeys = (keys, commands) => {
return commands[normalize(keys)];
};
const getCommand = keys => {
return findCommandByKeys(keys, getKeymaps().keys);
};
module.exports = {
normalize,
findCommandByKeys,
getCommand
};