remove only those folded regions that intersect with the updated console area
authorpeter <peter.gromov@jetbrains.com>
Thu, 4 Mar 2010 15:44:14 +0000 (15:44 +0000)
committerpeter <peter.gromov@jetbrains.com>
Thu, 4 Mar 2010 15:44:14 +0000 (15:44 +0000)
platform/lang-impl/src/com/intellij/execution/impl/ConsoleViewImpl.java

index e65f96af7c4cbdd77b92d86edbfbc865a36660d0..b1755e2b6dd1329b1a6acfe9a7d3ae9995784831 100644 (file)
@@ -854,8 +854,10 @@ public class ConsoleViewImpl extends JPanel implements ConsoleView, ObservableCo
     final int dirtyRegionStart = document.getLineStartOffset(startLine);
     final int diretyRegionEnd = document.getLineEndOffset(endLine);
     for (FoldRegion region : myEditor.getFoldingModel().getAllFoldRegions()) {
-      if (region.getStartOffset() >= dirtyRegionStart ||
-          region.getEndOffset() <= diretyRegionEnd) {
+      final int regStart = region.getStartOffset();
+      final int regEnd = region.getEndOffset();
+      if (regStart >= dirtyRegionStart && regStart <= dirtyRegionStart ||
+          regEnd >= dirtyRegionStart && regEnd <= diretyRegionEnd) {
         toRemove.add(region);
       }
     }