LeafBlockWrapper (final Block rootBlock, final @Nullable CompositeBlockWrapper parent, final boolean readOnly, final int index, @Nullable Block parentBlock) { if (!INLINE_TABS_ENABLED && !myCurrentWhiteSpace.containsLineFeeds()) { myCurrentWhiteSpace.setForceSkipTabulationsUsage(true); } TextRange textRange = rootBlock.getTextRange(); LeafBlockWrapper info = new LeafBlockWrapper(rootBlock, parent, myCurrentWhiteSpace, myModel, myOptions, myPreviousBlock, readOnly, textRange); if (index == 0) { info.arrangeParentTextRange(); } if (myPreviousBlock != null) { myPreviousBlock.setNextBlock(info); } if (myFirstTokenBlock == null) { myFirstTokenBlock = info; } myLastTokenBlock = info; if (currentWhiteSpaceIsReadOnly()) { myCurrentWhiteSpace.setReadOnly(true); } if (myCurrentSpaceProperty != null) { myCurrentWhiteSpace.setIsSafe(myCurrentSpaceProperty.isSafe()); myCurrentWhiteSpace.setKeepFirstColumn(myCurrentSpaceProperty.shouldKeepFirstColumn()); } if (info.isEndOfCodeBlock()) { myCurrentWhiteSpace.setBeforeCodeBlockEnd(true); } info.setSpaceProperty(myCurrentSpaceProperty); myCurrentWhiteSpace = new WhiteSpace(textRange.getEndOffset(), false); if (isDisabled(myCurrentWhiteSpace.getTextRange())) myCurrentWhiteSpace.setReadOnly(true); myPreviousBlock = info; if (myPositionOfInterest != -1 && (textRange.contains(myPositionOfInterest) || textRange.getEndOffset() == myPositionOfInterest)) { myResult.put(info, rootBlock); if (parent != null) myResult.put(parent, parentBlock); } return info; }