One of the fixes for EA19269 (PHP)
authorRustam.Vishnyakov <rustam.vishnyakov@gmail.com>
Wed, 28 Apr 2010 15:03:14 +0000 (19:03 +0400)
committerRustam.Vishnyakov <rustam.vishnyakov@gmail.com>
Wed, 28 Apr 2010 15:22:55 +0000 (19:22 +0400)
platform/lang-impl/src/com/intellij/formatting/templateLanguages/BlockUtil.java

index 1a67ea08ae7007b4c1dfeba8c486bf731bbec3e7..d6079a7dfb8b3b32f30441d9ed05ddd189ada259 100644 (file)
@@ -73,10 +73,11 @@ class BlockUtil {
       if (bounds.contains(textRange)) {
         createAndAddBlock(before, block, null);
       }
-      else if (bounds.getEndOffset() < textRange.getStartOffset()) {
+      else if (bounds.getEndOffset() <= textRange.getStartOffset()) {
         createAndAddBlock(after, block, null);
       }
       else {
+        //assert block.getSubBlocks().size() != 0 : "Block " + block.getTextRange() + " doesn't contain subblocks!";
         splitByRightBoundAndCollectBlocks(block.getSubBlocks(), before, after, bounds);
       }
     }