This commit is contained in:
Vanessa 2022-06-07 21:20:02 +08:00
parent 6fc62d12ee
commit f6d0be00d6
3 changed files with 14 additions and 1 deletions

View file

@ -646,6 +646,18 @@ const fileTreeKeydown = (event: KeyboardEvent) => {
return false;
}
const files = dockFile.data.file as Files;
if (matchHotKey(window.siyuan.config.keymap.general.selectOpen1.custom, event)) {
event.preventDefault();
const element = document.querySelector(".layout__wnd--active > .layout-tab-bar > .item--focus") ||
document.querySelector(".layout-tab-bar > .item--focus");
if (element) {
const tab = getInstanceById(element.getAttribute("data-id")) as Tab;
if (tab && tab.model instanceof Editor) {
files.selectItem(tab.model.editor.protyle.notebookId, tab.model.editor.protyle.path);
}
}
return;
}
if (!files.element.previousElementSibling.classList.contains("block__icons--active")) {
return false;
}