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.
|
- fix: Current editor wouldn't get parsed, when it's switched from another editor being parsed.
|
||||||
- enhancement: Support macro in #include preprocessing statements.
|
- enhancement: Support macro in #include preprocessing statements.
|
||||||
- fix: In options -> code format -> Program, Choose astyle path button doesn't work.
|
- 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
|
Red Panda C++ Version 2.26
|
||||||
- enhancement: Code suggestion for embedded std::vectors.
|
- enhancement: Code suggestion for embedded std::vectors.
|
||||||
|
|
|
@ -704,17 +704,17 @@ void Project::renameUnit(PProjectUnit& unit, const QString &newFileName)
|
||||||
mParser->addProjectFile(newFileName,true);
|
mParser->addProjectFile(newFileName,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mParser)
|
||||||
|
mParser->invalidateFile(unit->fileName());
|
||||||
Editor * editor=unitEditor(unit);
|
Editor * editor=unitEditor(unit);
|
||||||
if (editor) {
|
if (editor) {
|
||||||
//prevent recurse
|
//prevent recurse
|
||||||
editor->saveAs(newFileName,true);
|
editor->saveAs(newFileName,true);
|
||||||
} else {
|
} else {
|
||||||
if (mParser)
|
|
||||||
mParser->invalidateFile(unit->fileName());
|
|
||||||
copyFile(unit->fileName(),newFileName,true);
|
copyFile(unit->fileName(),newFileName,true);
|
||||||
|
}
|
||||||
if (mParser)
|
if (mParser)
|
||||||
mParser->parseFile(newFileName,true);
|
mParser->parseFile(newFileName,true);
|
||||||
}
|
|
||||||
|
|
||||||
internalRemoveUnit(unit,false,true);
|
internalRemoveUnit(unit,false,true);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue