Merge branch 'master' into git

This commit is contained in:
Roy Qu 2022-02-09 21:06:45 +08:00
commit b0bd6475cd
3 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,7 @@
Red Panda C++ Version 0.14.2
- enhancement: file system view mode for project
- enhancement: remove / rename / create new folder in the files view
- fix: crash when there are catch blocks in the upper most scope
Red Panda C++ Version 0.14.1
- enhancement: custom theme

View File

@ -1248,12 +1248,12 @@ bool CppParser::isCurrentScope(const QString &command)
return (statement->command == s);
}
void CppParser::addSoloScopeLevel(PStatement& statement, int line)
void CppParser::addSoloScopeLevel(PStatement& statement, int line, bool shouldResetBlock)
{
// Add class list
PStatement parentScope;
if (statement && (statement->kind == StatementKind::skBlock)) {
if (shouldResetBlock && statement && (statement->kind == StatementKind::skBlock)) {
parentScope = statement->parentScope.lock();
while (parentScope && (parentScope->kind == StatementKind::skBlock)) {
parentScope = parentScope->parentScope.lock();
@ -1852,7 +1852,7 @@ void CppParser::handleCatchBlock()
mClassScope,
true,
false);
addSoloScopeLevel(block,startLine);
addSoloScopeLevel(block,startLine,false);
if (!mTokenizer[mIndex]->text.contains("..."))
scanMethodArgs(block,mTokenizer[mIndex]->text);
}

View File

@ -178,7 +178,7 @@ private:
bool isStatic);
void setInheritance(int index, const PStatement& classStatement, bool isStruct);
bool isCurrentScope(const QString& command);
void addSoloScopeLevel(PStatement& statement, int line); // adds new solo level
void addSoloScopeLevel(PStatement& statement, int line, bool shouldResetBlock = true); // adds new solo level
void removeScopeLevel(int line); // removes level
int skipBraces(int startAt);
int skipBracket(int startAt);