Skip to content

Commit

Permalink
fix escape char issue for Web IDE start editingInfo. [skip CI]
Browse files Browse the repository at this point in the history
  • Loading branch information
pigpigyyy committed Nov 15, 2023
1 parent f79f02d commit 12646a6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
13 changes: 7 additions & 6 deletions Assets/Script/Dev/Entry.yue
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
19 changes: 13 additions & 6 deletions Tools/dora-dora/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand All @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -1622,6 +1625,10 @@ export default function PersistentDrawerLeft() {
onStopRunning();
break;
}
case '.': {
onPlayControlClick("View Log");
break;
}
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion Tools/dora-dora/src/Frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export const PlayControl = (prop: PlayControlProp) => {
<BsTerminal/>
</ListItemIcon>
<ListItemText primary={ t("menu.viewLog") }/>
<div style={{fontSize: 10, color: Color.TextSecondary}}>Mod+P</div>
<div style={{fontSize: 10, color: Color.TextSecondary}}>Mod+.</div>
</StyledMenuItem>
<StyledMenuItem onClick={onClose("Stop")}>
<ListItemIcon>
Expand Down

0 comments on commit 12646a6

Please sign in to comment.