Vanessa 2023-06-01 14:56:21 +08:00
parent 8c35440a77
commit 74b4a00a2f
42 changed files with 426 additions and 270 deletions

View file

@ -810,7 +810,7 @@ export const globalShortcut = (app: App) => {
app.plugins.find(item => {
item.commands.find(command => {
if (command.callback &&
!command.fileTreeCallback && !command.editorCallback&& !command.dockCallback
!command.fileTreeCallback && !command.editorCallback && !command.dockCallback
&& matchHotKey(command.customHotkey, event)) {
matchCommand = true;
command.callback();
@ -1071,7 +1071,7 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
selectElements = [nodeElement];
}
movePathTo((toPath) => {
hintMoveBlock(toPath[0], selectElements, protyle);
hintMoveBlock(toPath[0], selectElements, protyle, app);
});
}
event.preventDefault();
@ -1084,7 +1084,7 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
return false;
}
if (matchHotKey(window.siyuan.config.keymap.editor.general.refresh.custom, event)) {
reloadProtyle(protyle, true);
reloadProtyle(protyle, app, true);
event.preventDefault();
return true;
}
@ -1106,19 +1106,19 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
id: protyle.block.parentID,
size: window.siyuan.config.editor.dynamicLoadBlocks,
}, getResponse => {
onGet(getResponse, protyle);
onGet({data: getResponse, protyle, app});
});
event.preventDefault();
return true;
}
// 没有光标时,无法撤销 https://ld246.com/article/1624021111567
if (matchHotKey(window.siyuan.config.keymap.editor.general.undo.custom, event)) {
protyle.undo.undo(protyle);
protyle.undo.undo(app, protyle);
event.preventDefault();
return true;
}
if (matchHotKey(window.siyuan.config.keymap.editor.general.redo.custom, event)) {
protyle.undo.redo(protyle);
protyle.undo.redo(app, protyle);
event.preventDefault();
return true;
}