Keymaps are now updated without restarting (#2455)
* Reload keymaps without restarting * Reattach key listeners when config have changed
This commit is contained in:
parent
319ff3bcd7
commit
81709073cf
6 changed files with 37 additions and 25 deletions
|
|
@ -43,6 +43,15 @@ config.subscribe(() => {
|
|||
}
|
||||
});
|
||||
|
||||
function checkDeprecatedExtendKeymaps() {
|
||||
modules.forEach(plugin => {
|
||||
if (plugin.extendKeymaps) {
|
||||
notify('Plugin warning!', `"${plugin._name}" use deprecated "extendKeymaps" handler`);
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
let updating = false;
|
||||
|
||||
function updatePlugins({force = false} = {}) {
|
||||
|
|
@ -84,6 +93,7 @@ function updatePlugins({force = false} = {}) {
|
|||
} else {
|
||||
notify('Plugins Updated', 'No changes!');
|
||||
}
|
||||
checkDeprecatedExtendKeymaps();
|
||||
watchers.forEach(fn => fn(err, {force}));
|
||||
}
|
||||
}
|
||||
|
|
@ -347,15 +357,6 @@ exports.getDecoratedConfig = () => {
|
|||
return translatedConfig;
|
||||
};
|
||||
|
||||
exports.checkDeprecatedExtendKeymaps = () => {
|
||||
modules.forEach(plugin => {
|
||||
if (plugin.extendKeymaps) {
|
||||
notify('Plugin warning!', `"${plugin._name}" use deprecated "extendKeymaps" handler`);
|
||||
return;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
exports.getDecoratedKeymaps = () => {
|
||||
const baseKeymaps = config.getKeymaps();
|
||||
// Ensure that all keys are in an array and don't use deprecated key combination`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue