From 6f6eef24879eb1df9e7ae264c80e2298240ef718 Mon Sep 17 00:00:00 2001 From: Dennis Ushakov Date: Mon, 14 May 2012 10:56:30 +0400 Subject: [PATCH] fix folding exception in haml --- .../src/com/intellij/indentation/IndentationFoldingBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/indentation/IndentationFoldingBuilder.java b/platform/lang-impl/src/com/intellij/indentation/IndentationFoldingBuilder.java index 5322803129ac..b084041e699a 100644 --- a/platform/lang-impl/src/com/intellij/indentation/IndentationFoldingBuilder.java +++ b/platform/lang-impl/src/com/intellij/indentation/IndentationFoldingBuilder.java @@ -32,7 +32,7 @@ public abstract class IndentationFoldingBuilder implements FoldingBuilder, DumbA private void collectDescriptors(@NotNull final ASTNode node, @NotNull final List descriptors) { final ASTNode[] children = node.getChildren(myTokenSet); if (children.length > 0) { - if (node.getTreeParent() !=null) { + if (node.getTreeParent() !=null && node.getTextLength() > 0) { descriptors.add(new FoldingDescriptor(node, node.getTextRange())); } for (ASTNode child : children) {