Do not build additional blocks if we are not in "reformat context mode" (Fixes some tests, returns previous behaviour to regular reformat)

This commit is contained in:
Yaroslav Lepenkin
2015-05-27 13:15:53 +03:00
parent 75ae88cd70
commit 2515a35447
@@ -181,6 +181,9 @@ class InitialInfoBuilder {
if (rootBlock instanceof ReadOnlyBlockInformationProvider) {
myReadOnlyBlockInformationProvider = (ReadOnlyBlockInformationProvider)rootBlock;
}
if (!isInsideFormattingRanges && !myCollectAlignmentsInsideFormattingRange) {
return processSimpleBlock(rootBlock, parent, true, index, parentBlock);
}
final List<Block> subBlocks = rootBlock.getSubBlocks();
if (subBlocks.isEmpty() || myReadOnlyBlockInformationProvider != null