Skip to content

Commit 0aae9f8

Browse files
committed
修正
1. 插件註釋格式錯誤 2. 指令區塊程式碼縮行不一致 3. Display 標題收合功能失效
1 parent 876b9ad commit 0aae9f8

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989

9090
#root>#root_command,
9191
#root>#root_display {
92-
overflow: visible;
92+
/* overflow: visible; */
9393
}
9494

9595
.root_title {

src/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,17 +1063,18 @@ class CommandBuilder {
10631063
}
10641064

10651065
static buildBlockCode(id, name, paramsName, isMZ) {
1066-
const body = EDITOR_COMMANDS.get(`id_${id}_command_editor`)?.getValue().replaceAll("\r\n", "\r\n ") || ""
1066+
const body = EDITOR_COMMANDS.get(`id_${id}_command_editor`)?.getValue().replaceAll("\r\n", "\r\n ") || ""
10671067

10681068
const mz = isMZ
10691069
? ` PluginManager.registerCommand(FILENAME, "${name}", function (${paramsName.length > 0 ? `{ ${paramsName} }` : ""}){
10701070
${body}
10711071
})`
10721072
: false
10731073

1074+
// MV require other 4 space for them
10741075
const mv = `
10751076
if(cmd === "${name}") {${paramsName.length > 0 ? `\n var [${paramsName}] = args` : ""}
1076-
${body}
1077+
${body.replaceAll("\r\n", "\r\n ")}
10771078
}`
10781079

10791080
return { mz, mv }
@@ -1241,7 +1242,7 @@ class Builder {
12411242
.filter(Fnc.getIfNotEmpty)
12421243
.join("")
12431244

1244-
return (note === "" ? "" : "/**:" + note + "\n */\n")
1245+
return (note === "" ? "" : "/*:" + note + "\n */\n")
12451246
+ (code === "" ? "" : "(()=>{\n" + code + "\n})()\n")
12461247
}
12471248

0 commit comments

Comments
 (0)