From: axelcl Date: Wed, 26 Oct 2005 22:02:29 +0000 (+0000) Subject: Improved support for comment folding X-Git-Url: http://git.phpeclipse.com?hp=616234a1a0e8fd0807d3ee5fbbee9838c1a2eafe Improved support for comment folding --- diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/folding/DefaultJavaFoldingStructureProvider.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/folding/DefaultJavaFoldingStructureProvider.java index 77a19ac..2396518 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/folding/DefaultJavaFoldingStructureProvider.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/folding/DefaultJavaFoldingStructureProvider.java @@ -641,6 +641,7 @@ public class DefaultJavaFoldingStructureProvider implements IProjectionListener, final int shift = range.getOffset(); int start = shift; + regions.add(new Region(range.getOffset(), range.getLength())); if (element instanceof IType) { Scanner scanner = ToolFactory.createScanner(true, false, false, false); scanner.setSource(contents.toCharArray()); @@ -662,8 +663,9 @@ public class DefaultJavaFoldingStructureProvider implements IProjectionListener, continue; } } + regions.add(new Region(start, shift + range.getLength() - start)); } - regions.add(new Region(start, shift + range.getLength() - start)); + if (regions.size() > 0) { IRegion[] result = new IRegion[regions.size()];