fix: project not correctly reparsed after rename unit.

This commit is contained in:
Roy Qu 2024-05-03 08:38:54 +08:00
parent c5cd30eb2a
commit 68209fe619
2 changed files with 5 additions and 4 deletions

View File

@ -157,6 +157,7 @@ Red Panda C++ Version 2.27
- fix: Current editor wouldn't get parsed, when it's switched from another editor being parsed.
- enhancement: Support macro in #include preprocessing statements.
- fix: In options -> code format -> Program, Choose astyle path button doesn't work.
- fix: project not correctly reparsed after rename unit.
Red Panda C++ Version 2.26
- enhancement: Code suggestion for embedded std::vectors.

View File

@ -704,17 +704,17 @@ void Project::renameUnit(PProjectUnit& unit, const QString &newFileName)
mParser->addProjectFile(newFileName,true);
}
if (mParser)
mParser->invalidateFile(unit->fileName());
Editor * editor=unitEditor(unit);
if (editor) {
//prevent recurse
editor->saveAs(newFileName,true);
} else {
if (mParser)
mParser->invalidateFile(unit->fileName());
copyFile(unit->fileName(),newFileName,true);
if (mParser)
mParser->parseFile(newFileName,true);
}
if (mParser)
mParser->parseFile(newFileName,true);
internalRemoveUnit(unit,false,true);