mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 08:30:12 +01:00
This commit is contained in:
parent
6790c990ba
commit
29117c764d
1 changed files with 5 additions and 2 deletions
|
|
@ -21,6 +21,7 @@ import {openFileById} from "../editor/util";
|
|||
import {focusByRange} from "../protyle/util/selection";
|
||||
import {exitSiYuan} from "../dialog/processSystem";
|
||||
import {openSetting} from "../config";
|
||||
import {getSearch} from "./functions";
|
||||
|
||||
const matchKeymap = (keymap: Record<string, IKeymapItem>, key1: "general" | "editor", key2?: "general" | "insert" | "heading" | "list" | "table") => {
|
||||
if (key1 === "general") {
|
||||
|
|
@ -346,12 +347,14 @@ const initWindow = () => {
|
|||
const currentWindow = getCurrentWindow();
|
||||
currentWindow.on("focus", winOnFocus);
|
||||
ipcRenderer.on(Constants.SIYUAN_OPENURL, (event, url) => {
|
||||
const params = url.split("?");
|
||||
if (!/^siyuan:\/\/blocks\/\d{14}-\w{7}/.test(url)) {
|
||||
return;
|
||||
}
|
||||
openFileById({
|
||||
id: url.substr(16, 22),
|
||||
hasContext: true,
|
||||
action: [Constants.CB_GET_FOCUS],
|
||||
zoomIn: params.length === 2 && params[1].startsWith("focus=1")
|
||||
zoomIn: getSearch("focus", url) === "1"
|
||||
});
|
||||
});
|
||||
ipcRenderer.on(Constants.SIYUAN_SAVE_CLOSE, (event, close) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue