From 12646a613ad19ca765d2b281e4d29b34dfaa2d00 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Wed, 15 Nov 2023 17:16:02 +0800 Subject: [PATCH] fix escape char issue for Web IDE start editingInfo. [skip CI] --- Assets/Script/Dev/Entry.yue | 13 +++++++------ Tools/dora-dora/src/App.tsx | 19 +++++++++++++------ Tools/dora-dora/src/Frame.tsx | 2 +- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/Assets/Script/Dev/Entry.yue b/Assets/Script/Dev/Entry.yue index d011f5b9f..0f41385e9 100644 --- a/Assets/Script/Dev/Entry.yue +++ b/Assets/Script/Dev/Entry.yue @@ -106,15 +106,16 @@ if not config.locale? config.locale = App.locale if not config.editingInfo? - config.editingInfo = "{ - \"index\":0, - \"files\":[ + import "json" + config.editingInfo = json.dump { + index: 0 + files: [ { - \"key\":\"#{Path Content.assetPath, 'Doc', (App.locale\match('^zh')? and 'zh-Hans' or 'en'), 'welcome.md'}\", - \"title\":\"welcome.md\" + key: Path Content.assetPath, 'Doc', (App.locale\match('^zh')? and 'zh-Hans' or 'en'), 'welcome.md' + title: "welcome.md" } ] - }" + } showStats = false if config.showStats? diff --git a/Tools/dora-dora/src/App.tsx b/Tools/dora-dora/src/App.tsx index 257003cee..ddfece615 100644 --- a/Tools/dora-dora/src/App.tsx +++ b/Tools/dora-dora/src/App.tsx @@ -181,7 +181,6 @@ export default function PersistentDrawerLeft() { Service.editingInfo().then((res: {success: boolean, editingInfo?: string}) => { if (res.success && res.editingInfo) { const editingInfo: Service.EditingInfo = JSON.parse(res.editingInfo); - console.log(editingInfo); editingInfo.files.forEach((file, i) => { openFileInTab(file.key, file.title, file.position, file.mdEditing, i, editingInfo.index); }); @@ -197,7 +196,8 @@ export default function PersistentDrawerLeft() { case 'W': case 'w': case 'R': case 'r': case 'P': case 'p': - case 'Q': case 'q': { + case 'Q': case 'q': + case '.': { event.preventDefault(); setKeyEvent(event); break; @@ -1481,10 +1481,13 @@ export default function PersistentDrawerLeft() { setOpenFilter(true); return; } else if (mode === "View Log") { - setOpenLog({ - title: t("menu.viewLog"), - stopOnClose: false - }); + if (openLog === null) { + setOpenLog({ + title: t("menu.viewLog"), + stopOnClose: false + }); + } + return; } saveAllTabs().then((success) => { if (!success) { @@ -1622,6 +1625,10 @@ export default function PersistentDrawerLeft() { onStopRunning(); break; } + case '.': { + onPlayControlClick("View Log"); + break; + } } } }; diff --git a/Tools/dora-dora/src/Frame.tsx b/Tools/dora-dora/src/Frame.tsx index f7908098f..4fcf06cc5 100644 --- a/Tools/dora-dora/src/Frame.tsx +++ b/Tools/dora-dora/src/Frame.tsx @@ -193,7 +193,7 @@ export const PlayControl = (prop: PlayControlProp) => { -
Mod+P
+
Mod+.