From b03869c26a58b7f9cf65ef992053cb8ce14b3778 Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Tue, 30 Oct 2007 10:32:30 +0000 Subject: [PATCH] Fix for 190860: functions are folded when navigating to an unopened file (follow-up) --- .../ui/text/folding/DefaultCFoldingStructureProvider.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } } }