mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for 190860: functions are folded when navigating to an unopened file (follow-up)
This commit is contained in:
parent
d3fd594242
commit
b03869c26a
1 changed files with 2 additions and 1 deletions
|
@ -1154,7 +1154,8 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi
|
||||||
IRegion aligned = alignRegion(branch, ctx, branch.fInclusive);
|
IRegion aligned = alignRegion(branch, ctx, branch.fInclusive);
|
||||||
if (aligned != null) {
|
if (aligned != null) {
|
||||||
Position alignedPos= new Position(aligned.getOffset(), aligned.getLength());
|
Position alignedPos= new Position(aligned.getOffset(), aligned.getLength());
|
||||||
ctx.addProjectionRange(new CProjectionAnnotation(!branch.taken() && ctx.collapseInactiveCode(), computeKey(branch, ctx), false), alignedPos);
|
final boolean collapse= !branch.taken() && ctx.collapseInactiveCode() && !alignedPos.includes(fCursorPosition);
|
||||||
|
ctx.addProjectionRange(new CProjectionAnnotation(collapse, computeKey(branch, ctx), false), alignedPos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue