mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-21 19:41:05 +08:00
This commit is contained in:
parent
b2660ea088
commit
6f4b0421f1
@ -1148,6 +1148,26 @@ const fileTreeKeydown = (app: App, event: KeyboardEvent) => {
|
|||||||
}
|
}
|
||||||
const files = dockFile.data.file as Files;
|
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 > .fn__flex > .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) {
|
||||||
|
tab.model.editor.protyle.wysiwyg.element.blur();
|
||||||
|
tab.model.editor.protyle.title.editElement.blur();
|
||||||
|
files.selectItem(tab.model.editor.protyle.notebookId, tab.model.editor.protyle.path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dockFile.toggleModel("file", true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!files.element.parentElement.classList.contains("layout__tab--active")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
let matchCommand = false;
|
let matchCommand = false;
|
||||||
app.plugins.find(item => {
|
app.plugins.find(item => {
|
||||||
item.commands.find(command => {
|
item.commands.find(command => {
|
||||||
@ -1165,24 +1185,6 @@ const fileTreeKeydown = (app: App, event: KeyboardEvent) => {
|
|||||||
return true;
|
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") ||
|
|
||||||
document.querySelector(".layout-tab-bar > .item--focus");
|
|
||||||
if (element) {
|
|
||||||
const tab = getInstanceById(element.getAttribute("data-id")) as Tab;
|
|
||||||
if (tab && tab.model instanceof Editor) {
|
|
||||||
tab.model.editor.protyle.wysiwyg.element.blur();
|
|
||||||
tab.model.editor.protyle.title.editElement.blur();
|
|
||||||
files.selectItem(tab.model.editor.protyle.notebookId, tab.model.editor.protyle.path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dockFile.toggleModel("file", true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!files.element.parentElement.classList.contains("layout__tab--active")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
const liElements = Array.from(files.element.querySelectorAll(".b3-list-item--focus"));
|
const liElements = Array.from(files.element.querySelectorAll(".b3-list-item--focus"));
|
||||||
if (liElements.length === 0) {
|
if (liElements.length === 0) {
|
||||||
if (event.key.startsWith("Arrow") && !isCtrl(event)) {
|
if (event.key.startsWith("Arrow") && !isCtrl(event)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user