IndentData (@NotNull Context context) { LeafBlockWrapper offsetResponsibleBlock = context.alignment().getOffsetRespBlockBefore(context.targetBlock()); if (offsetResponsibleBlock == null) { return null; } final WhiteSpace whiteSpace = offsetResponsibleBlock.getWhiteSpace(); if (whiteSpace.containsLineFeeds()) { return new IndentData(whiteSpace.getIndentSpaces(), whiteSpace.getSpaces()); } else { final int offsetBeforeBlock = CoreFormatterUtil.getStartColumn(offsetResponsibleBlock); final AbstractBlockWrapper prevIndentedBlock = CoreFormatterUtil.getIndentedParentBlock(context.targetBlock()); if (prevIndentedBlock == null) { return new IndentData(0, offsetBeforeBlock); } else { final int parentIndent = prevIndentedBlock.getWhiteSpace().getIndentOffset(); if (parentIndent > offsetBeforeBlock) { return new IndentData(0, offsetBeforeBlock); } else { return new IndentData(parentIndent, offsetBeforeBlock - parentIndent); } } } }