Skip to content

Commit adb8431

Browse files
committed
Fix wnd undefined if asset source unopened
Fix broken asset edit and undo when the asset source file has not been opened manually, for example when reloading the #asseteditor page directly.
1 parent b50f7d1 commit adb8431

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/ide/windows.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export class ProjectWindows {
145145
}
146146

147147
replaceTextRange(fileid: string, from: number, to: number, text: string) {
148-
var wnd = this.id2window[fileid];
148+
var wnd = this.id2window[fileid] || this.create(fileid);
149149
wnd.replaceTextRange(from, to, text);
150150
this.undofiles.push(fileid);
151151
this.redofiles = [];

0 commit comments

Comments
 (0)