Vanessa 2023-10-29 09:29:36 +08:00
parent f46e0d48ad
commit b8f56f4a1d
7 changed files with 20 additions and 20 deletions

View file

@ -29,6 +29,7 @@ import {App} from "../index";
import {initWindowEvent} from "./globalEvent/event";
import {sendGlobalShortcut} from "./globalEvent/keydown";
import {closeWindow} from "../window/closeWin";
import {loadPlugins} from "../plugin/loader";
const matchKeymap = (keymap: Record<string, IKeymapItem>, key1: "general" | "editor", key2?: "general" | "insert" | "heading" | "list" | "table") => {
if (key1 === "general") {
@ -87,7 +88,7 @@ const hasKeymap = (keymap: Record<string, IKeymapItem>, key1: "general" | "edito
return match;
};
export const onGetConfig = (isStart: boolean, app: App) => {
export const onGetConfig = async (isStart: boolean, app: App) => {
const matchKeymap1 = matchKeymap(Constants.SIYUAN_KEYMAP.general, "general");
const matchKeymap2 = matchKeymap(Constants.SIYUAN_KEYMAP.editor.general, "editor", "general");
const matchKeymap3 = matchKeymap(Constants.SIYUAN_KEYMAP.editor.insert, "editor", "insert");
@ -140,8 +141,9 @@ export const onGetConfig = (isStart: boolean, app: App) => {
initWindow(app);
appearance.onSetappearance(window.siyuan.config.appearance);
initAssets();
renderSnippet();
setInlineStyle();
await loadPlugins(app);
renderSnippet();
let resizeTimeout = 0;
window.addEventListener("resize", () => {
window.clearTimeout(resizeTimeout);