Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: fix https://github.com/siyuan-note/siyuan/issues/9754

Vanessa7ef757782178
diff --git a/app/src/boot/globalEvent/keydown.ts b/app/src/boot/globalEvent/keydown.ts
index 428cbc35f2..48bd595ab8 100644
--- a/app/src/boot/globalEvent/keydown.ts
+++ b/app/src/boot/globalEvent/keydown.ts
@@ -72,6 +72,7 @@ import {quickMakeCard} from "../../card/makeCard";
import {copyPNG} from "../../menus/util";
import {getContentByInlineHTML} from "../../protyle/wysiwyg/keydown";
import {searchKeydown} from "./searchKeydown";
+import {openNewWindow} from "../../window/openNewWindow";
const switchDialogEvent = (app: App, event: MouseEvent) => {
event.preventDefault();
@@ -1577,14 +1578,19 @@ export const windowKeyDown = (app: App, event: KeyboardEvent) => {
return;
}
- if ((matchHotKey(window.siyuan.config.keymap.general.splitLR.custom, event) ||
+ if ((
+ matchHotKey(window.siyuan.config.keymap.general.splitLR.custom, event) ||
matchHotKey(window.siyuan.config.keymap.general.splitMoveR.custom, event) ||
matchHotKey(window.siyuan.config.keymap.general.splitTB.custom, event) ||
- matchHotKey(window.siyuan.config.keymap.general.splitMoveB.custom, event)) && !event.repeat) {
+ matchHotKey(window.siyuan.config.keymap.general.tabToWindow.custom, event) ||
+ matchHotKey(window.siyuan.config.keymap.general.splitMoveB.custom, event)
+ ) && !event.repeat) {
event.preventDefault();
const tab = getActiveTab(false);
if (tab) {
- if (matchHotKey(window.siyuan.config.keymap.general.splitLR.custom, event)) {
+ if (matchHotKey(window.siyuan.config.keymap.general.tabToWindow.custom, event)) {
+ openNewWindow(tab);
+ } else if (matchHotKey(window.siyuan.config.keymap.general.splitLR.custom, event)) {
tab.parent.split("lr").addTab(copyTab(app, tab));
} else if (matchHotKey(window.siyuan.config.keymap.general.splitTB.custom, event)) {
tab.parent.split("tb").addTab(copyTab(app, tab));
diff --git a/app/src/constants.ts b/app/src/constants.ts
index 08beb0e29f..622de6bcf5 100644
--- a/app/src/constants.ts
+++ b/app/src/constants.ts
@@ -279,6 +279,7 @@ export abstract class Constants {
closeUnmodified: {default: "", custom: ""},
closeLeft: {default: "", custom: ""},
closeRight: {default: "", custom: ""},
+ tabToWindow: {default: "", custom: ""},
},
editor: {
general: {
diff --git a/app/src/menus/tab.ts b/app/src/menus/tab.ts
index 77ee68184f..19315a6790 100644
--- a/app/src/menus/tab.ts
+++ b/app/src/menus/tab.ts
@@ -210,6 +210,7 @@ export const initTabMenu = (app: App, tab: Tab) => {
/// #if !BROWSER
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.tabToWindow,
+ accelerator: window.siyuan.config.keymap.general.tabToWindow.custom,
icon: "iconOpenWindow",
click: () => {
openNewWindow(tab);