fix: project not correctly reparsed after rename unit.
This commit is contained in:
parent
c5cd30eb2a
commit
68209fe619
1
NEWS.md
1
NEWS.md
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue