Vanessa 2025-12-24 21:12:00 +08:00
parent a02c616f22
commit 8520b02df5
3 changed files with 18 additions and 4 deletions

View file

@ -80,9 +80,12 @@ export class Plugin {
});
this.updateProtyleToolbar([]).forEach(toolbarItem => {
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name) || !toolbarItem.hotkey) {
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name)) {
return;
}
if (typeof toolbarItem.hotkey !== "string") {
toolbarItem.hotkey = "";
}
if (!window.siyuan.config.keymap.plugin) {
window.siyuan.config.keymap.plugin = {};
}
@ -99,6 +102,8 @@ export class Plugin {
default: toolbarItem.hotkey,
custom: toolbarItem.hotkey,
};
} else {
window.siyuan.config.keymap.plugin[options.name][toolbarItem.name].default = toolbarItem.hotkey;
}
});
}