- fix: Result of scope calculation not right if a for statement immediately follows another for statement.
This commit is contained in:
parent
7324475277
commit
5f75fd97cd
1
NEWS.md
1
NEWS.md
|
@ -22,6 +22,7 @@ Red Panda C++ Version 2.8
|
||||||
- fix: Can't save new file using filename with custom suffix.
|
- fix: Can't save new file using filename with custom suffix.
|
||||||
- fix: alt+shift+left/right can't select
|
- fix: alt+shift+left/right can't select
|
||||||
- fix: Input any content will exit column mode.
|
- fix: Input any content will exit column mode.
|
||||||
|
- fix: Result of scope calculation not right if a for statement immediately follows another for statement.
|
||||||
|
|
||||||
Red Panda C++ Version 2.7
|
Red Panda C++ Version 2.7
|
||||||
|
|
||||||
|
|
|
@ -512,8 +512,8 @@ PStatement CppScopes::findScopeAtLine(int line)
|
||||||
int mid = (start+end)/2;
|
int mid = (start+end)/2;
|
||||||
PCppScope midScope = mScopes[mid];
|
PCppScope midScope = mScopes[mid];
|
||||||
if (midScope->startLine == line) {
|
if (midScope->startLine == line) {
|
||||||
while (mid-1>=0 && (mScopes[mid-1]->startLine == line)) {
|
while (mid<end && (mScopes[mid+1]->startLine == line)) {
|
||||||
mid--;
|
mid++;
|
||||||
}
|
}
|
||||||
return mScopes[mid]->statement;
|
return mScopes[mid]->statement;
|
||||||
} else if (midScope->startLine > line) {
|
} else if (midScope->startLine > line) {
|
||||||
|
|
Loading…
Reference in New Issue