From c997467c801cf320c7f1ec9b14d20c686896e882 Mon Sep 17 00:00:00 2001 From: axelcl Date: Wed, 26 Oct 2005 22:02:29 +0000 Subject: [PATCH] Improved support for comment folding --- .../DefaultJavaFoldingStructureProvider.java | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) 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()]; -- 1.7.1