提交 c8e55ad3 编写于 作者: B Benjamin Pasero

Accelerators in menu do not update btw restarts (fixes #1370)

上级 60187a8b
......@@ -90,6 +90,7 @@ export class VSCodeMenu {
// Should not happen
}
// Fill hash map of resolved keybindings
let needsMenuUpdate = false;
keybindings.forEach((keybinding) => {
let accelerator = new Keybinding(keybinding.binding)._toElectronAccelerator();
......@@ -101,8 +102,15 @@ export class VSCodeMenu {
}
});
// A keybinding might have been unassigned, so we have to account for that too
if (Object.keys(this.mapLastKnownKeybindingToActionId).length !== Object.keys(this.mapResolvedKeybindingToActionId).length) {
needsMenuUpdate = true;
}
if (needsMenuUpdate) {
storage.setItem(VSCodeMenu.lastKnownKeybindingsMapStorageKey, this.mapResolvedKeybindingToActionId); // keep to restore instantly after restart
this.mapLastKnownKeybindingToActionId = this.mapResolvedKeybindingToActionId; // update our last known map
this.updateMenu();
}
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册