Vanessa 2024-05-23 23:45:10 +08:00
parent 9f86cb33a7
commit 91a3184d0f

View file

@ -1213,6 +1213,13 @@ export class Gutter {
}
const copyMenu = (copySubMenu(id, true, nodeElement) as IMenu[]).concat([{
label: window.siyuan.languages.copyPlainText,
accelerator: window.siyuan.config.keymap.editor.general.copyPlainText.custom,
click() {
copyPlainText(getPlainText(nodeElement as HTMLElement).trimEnd());
focusBlock(nodeElement);
}
}, {
label: type === "NodeAttributeView" ? window.siyuan.languages.copyMirror : window.siyuan.languages.copy,
accelerator: "⌘C",
click() {
@ -1223,13 +1230,6 @@ export class Gutter {
}
document.execCommand("copy");
}
}, {
label: window.siyuan.languages.copyPlainText,
accelerator: window.siyuan.config.keymap.editor.general.copyPlainText.custom,
click() {
copyPlainText(getPlainText(nodeElement as HTMLElement).trimEnd());
focusBlock(nodeElement);
}
}, {
label: type === "NodeAttributeView" ? window.siyuan.languages.duplicateMirror : window.siyuan.languages.duplicate,
accelerator: window.siyuan.config.keymap.editor.general.duplicate.custom,
@ -1266,7 +1266,7 @@ export class Gutter {
}
const copyTextRefMenu = this.genCopyTextRef([nodeElement]);
if (copyTextRefMenu) {
copyMenu.splice(copyMenu.length - 1, 0, copyTextRefMenu);
copyMenu.splice(7, 0, copyTextRefMenu);
}
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.copy,