This commit is contained in:
Vanessa 2023-06-16 00:01:44 +08:00
parent 99b1b0e5d0
commit 3116650965
3 changed files with 36 additions and 2 deletions

View file

@ -1212,6 +1212,7 @@ const fileTreeKeydown = (app: App, event: KeyboardEvent) => {
event.preventDefault();
return true;
}
if (matchHotKey("⌘/", event)) {
const liRect = liElements[0].getBoundingClientRect();
if (isFile) {
@ -1224,6 +1225,7 @@ const fileTreeKeydown = (app: App, event: KeyboardEvent) => {
}
return true;
}
if (isFile && matchHotKey(window.siyuan.config.keymap.general.move.custom, event)) {
window.siyuan.menus.menu.remove();
const pathes = getTopPaths(liElements);
@ -1233,6 +1235,19 @@ const fileTreeKeydown = (app: App, event: KeyboardEvent) => {
event.preventDefault();
return true;
}
if (isFile && matchHotKey(window.siyuan.config.keymap.editor.general.insertRight.custom, event)) {
window.siyuan.menus.menu.remove();
openFileById({
app,
id: liElements[0].getAttribute("data-node-id"),
action: [Constants.CB_GET_FOCUS],
position: "right",
});
event.preventDefault();
return true;
}
let searchKey = "";
if (matchHotKey(window.siyuan.config.keymap.general.replace.custom, event)) {
searchKey = window.siyuan.config.keymap.general.replace.custom;

View file

@ -11,6 +11,7 @@ import {Constants} from "../constants";
import {openNewWindowById} from "../window/openNewWindow";
import {MenuItem} from "./Menu";
import {App} from "../index";
import {updateHotkeyTip} from "../protyle/util/compatibility";
export const exportAsset = (src: string) => {
/// #if !BROWSER
@ -37,7 +38,7 @@ export const openEditorTab = (app: App, id: string, notebookId?: string, pathStr
const openSubmenus: IMenu[] = [{
icon: "iconLayoutRight",
label: window.siyuan.languages.insertRight,
accelerator: "⌥Click",
accelerator: `${updateHotkeyTip(window.siyuan.config.keymap.editor.general.insertRight.custom)}/${updateHotkeyTip("⌥Click")}`,
click: () => {
openFileById({app, id, position: "right", action: [Constants.CB_GET_FOCUS]});
}

View file

@ -168,7 +168,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
<kbd>${updateHotkeyTip(window.siyuan.config.keymap.general.newFile.custom)}</kbd> ${window.siyuan.languages.new}
<kbd>Enter/Double Click</kbd> ${window.siyuan.languages.searchTip2}
<kbd>Click</kbd> ${window.siyuan.languages.searchTip3}
<kbd>${updateHotkeyTip("⌥Click")}</kbd> ${window.siyuan.languages.searchTip4}
<kbd>${updateHotkeyTip(window.siyuan.config.keymap.editor.general.insertRight.custom)}/${updateHotkeyTip("⌥Click")}</kbd> ${window.siyuan.languages.searchTip4}
<kbd>Esc</kbd> ${window.siyuan.languages.searchTip5}
</div>
</div>
@ -720,6 +720,24 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
if (!currentList || event.isComposing) {
return;
}
if (searchInputElement.value && matchHotKey(window.siyuan.config.keymap.editor.general.insertRight.custom, event)) {
const id = currentList.getAttribute("data-node-id");
fetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => {
openFileById({
app,
id,
position: "right",
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],
zoomIn: foldResponse.data
});
if (closeCB) {
closeCB();
}
});
event.preventDefault();
event.stopPropagation();
return;
}
if (searchInputElement.value && matchHotKey(window.siyuan.config.keymap.general.newFile.custom, event)) {
newFileByName(app, searchInputElement.value);
event.preventDefault();