Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2007-10-30 10:32:30 +0000
committerAnton Leherbauer2007-10-30 10:32:30 +0000
commitb03869c26a58b7f9cf65ef992053cb8ce14b3778 (patch)
tree0082ff032b039673e8d8cb062e4a39c7b6881b37
parentd3fd594242c0a9c39b7802e57cd942276e299584 (diff)
downloadorg.eclipse.cdt-b03869c26a58b7f9cf65ef992053cb8ce14b3778.tar.gz
org.eclipse.cdt-b03869c26a58b7f9cf65ef992053cb8ce14b3778.tar.xz
org.eclipse.cdt-b03869c26a58b7f9cf65ef992053cb8ce14b3778.zip
Fix for 190860: functions are folded when navigating to an unopened file (follow-up)
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingStructureProvider.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingStructureProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingStructureProvider.java
index c3581905bd3..8e50bc0c2bd 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingStructureProvider.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/folding/DefaultCFoldingStructureProvider.java
@@ -1154,7 +1154,8 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi
IRegion aligned = alignRegion(branch, ctx, branch.fInclusive);
if (aligned != null) {
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);
}
}
}

Back to the top