diff --git a/plugins/properties/src/com/intellij/lang/properties/formatting/PropertiesRootBlock.java b/plugins/properties/src/com/intellij/lang/properties/formatting/PropertiesRootBlock.java index 21a0ff3b4a8d..458aecaaac72 100644 --- a/plugins/properties/src/com/intellij/lang/properties/formatting/PropertiesRootBlock.java +++ b/plugins/properties/src/com/intellij/lang/properties/formatting/PropertiesRootBlock.java @@ -62,12 +62,16 @@ public class PropertiesRootBlock extends AbstractBlock { if (propertyNode.getElementType() instanceof PropertyStubElementType) { collectPropertyBlock(propertyNode, result); } - else if (PropertiesTokenTypes.END_OF_LINE_COMMENT.equals(propertyNode.getElementType())) { + else if (PropertiesTokenTypes.END_OF_LINE_COMMENT.equals(propertyNode.getElementType()) || + PropertiesTokenTypes.BAD_CHARACTER.equals(propertyNode.getElementType())) { result.add(new PropertyBlock(propertyNode, null)); } propertyNode = propertyNode.getTreeNext(); } } + else if (PropertiesTokenTypes.BAD_CHARACTER.equals(child.getElementType())) { + result.add(new PropertyBlock(child, null)); + } } if (PropertiesTokenTypes.END_OF_LINE_COMMENT.equals(child.getElementType())) { result.add(new PropertyBlock(child, null));