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/8931

Vanessa6f4b0421f188
diff --git a/app/src/boot/globalShortcut.ts b/app/src/boot/globalShortcut.ts
index 3d94fdec6c..89de5d8a4a 100644
--- a/app/src/boot/globalShortcut.ts
+++ b/app/src/boot/globalShortcut.ts
@@ -1148,23 +1148,6 @@ const fileTreeKeydown = (app: App, event: KeyboardEvent) => {
}
const files = dockFile.data.file as Files;
- let matchCommand = false;
- app.plugins.find(item => {
- item.commands.find(command => {
- if (command.fileTreeCallback && matchHotKey(command.customHotkey, event)) {
- matchCommand = true;
- command.fileTreeCallback(files);
- return true;
- }
- });
- if (matchCommand) {
- return true;
- }
- });
- if (matchCommand) {
- return true;
- }
-
if (matchHotKey(window.siyuan.config.keymap.general.selectOpen1.custom, event)) {
event.preventDefault();
const element = document.querySelector(".layout__wnd--active > .fn__flex > .layout-tab-bar > .item--focus") ||
@@ -1180,9 +1163,28 @@ const fileTreeKeydown = (app: App, event: KeyboardEvent) => {
dockFile.toggleModel("file", true);
return;
}
+
if (!files.element.parentElement.classList.contains("layout__tab--active")) {
return false;
}
+
+ let matchCommand = false;
+ app.plugins.find(item => {
+ item.commands.find(command => {
+ if (command.fileTreeCallback && matchHotKey(command.customHotkey, event)) {
+ matchCommand = true;
+ command.fileTreeCallback(files);
+ return true;
+ }
+ });
+ if (matchCommand) {
+ return true;
+ }
+ });
+ if (matchCommand) {
+ return true;
+ }
+
const liElements = Array.from(files.element.querySelectorAll(".b3-list-item--focus"));
if (liElements.length === 0) {
if (event.key.startsWith("Arrow") && !isCtrl(event)) {