Merge branch 'master' into v2
This commit is contained in:
commit
f8c19b0ef2
5 changed files with 21 additions and 71 deletions
|
|
@ -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
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue