Skip to content

Commit 736e118

Browse files
committed
use unsaved editors in multifile assembly
1 parent f62d7f7 commit 736e118

File tree

6 files changed

+19
-15
lines changed

6 files changed

+19
-15
lines changed

dist/webpage/editor/editor.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/webpage/editor/editor.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/webpage/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/webpage/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/webpage/editor/editor.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,7 @@ class Editor extends EventTarget {
924924
mut.observe(c);
925925
this.renderToCanvas(ctx);
926926
}
927+
static editMap = new Map<string, Editor>();
927928
async assemble() {
928929
//TODO I'm sure there's more I can do to make this much smaller in RAM
929930
try {
@@ -939,7 +940,12 @@ class Editor extends EventTarget {
939940
if (!name.endsWith(".asm")) continue;
940941
const thisDir = dir + name;
941942
if (thisDir === this.fileDir) continue;
942-
build.push([await thing.text(), thisDir]);
943+
const editor = Editor.editMap.get(thisDir);
944+
if (editor) {
945+
build.push([editor.string(), thisDir]);
946+
} else {
947+
build.push([await thing.text(), thisDir]);
948+
}
943949
}
944950
const [ram, pc] = assemble(build);
945951
emu = new Symstem(ram, this.console);

0 commit comments

Comments
 (0)