diff --git a/src/tools/ecode/appconfig.cpp b/src/tools/ecode/appconfig.cpp index 4b96830b0..12ac88f20 100644 --- a/src/tools/ecode/appconfig.cpp +++ b/src/tools/ecode/appconfig.cpp @@ -368,10 +368,15 @@ json saveNode( Node* node ) { continue; if ( ownedWidget->isType( UI_TYPE_CODEEDITOR ) ) { UICodeEditor* editor = ownedWidget->asType(); - if ( !editor->getDocument().getFilePath().empty() ) { + if ( !editor->getDocument().isLoading() && editor->getDocument().isEmpty() ) + continue; + if ( !editor->getDocument().getFilePath().empty() || + !editor->getDocument().getLoadingFilePath().empty() ) { json f; f["type"] = "editor"; - f["path"] = editor->getDocument().getFilePath(); + f["path"] = editor->getDocument().isLoading() + ? editor->getDocument().getLoadingFilePath() + : editor->getDocument().getFilePath(); f["selection"] = editor->getDocument().getSelections().toString(); files.emplace_back( f ); } diff --git a/src/tools/ecode/ecode.cpp b/src/tools/ecode/ecode.cpp index b812fec88..82b107a86 100644 --- a/src/tools/ecode/ecode.cpp +++ b/src/tools/ecode/ecode.cpp @@ -2195,10 +2195,11 @@ bool App::isUnlockedCommand( const std::string& command ) { } void App::saveProject() { - if ( !mCurrentProject.empty() ) + if ( !mCurrentProject.empty() ) { mConfig.saveProject( mCurrentProject, mSplitter, mConfigPath, mProjectDocConfig, mProjectBuildManager ? mProjectBuildManager->getConfig() : ProjectBuildConfiguration() ); + } } void App::closeEditors() {