File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -1470,12 +1470,19 @@ export class ProjectView
14701470 }
14711471
14721472 updateFileAsync ( name : string , content : string , open ?: boolean ) : Promise < void > {
1473- const p = pkg . mainEditorPkg ( ) ;
1474- return p . setContentAsync ( name , content )
1473+ const mainPkg = pkg . mainEditorPkg ( ) ;
1474+ return mainPkg . setContentAsync ( name , content )
1475+ . then ( ( ) => this . reloadHeaderAsync ( ) )
14751476 . then ( ( ) => {
1476- if ( open ) this . setFile ( p . lookupFile ( "this/" + name ) ) ;
1477+ if ( open ) {
1478+ const reloadedPkg = pkg . mainEditorPkg ( ) ;
1479+ const file = reloadedPkg . lookupFile ( "this/" + name ) ;
1480+ if ( file ) {
1481+ if ( pxteditor . isBlocks ( file ) ) this . setSideFile ( file ) ;
1482+ else this . setFile ( file ) ;
1483+ }
1484+ }
14771485 } )
1478- . then ( ( ) => this . reloadHeaderAsync ( ) )
14791486 }
14801487
14811488 isSideDocExpanded ( ) : boolean {
You can’t perform that action at this time.
0 commit comments