SpacingImpl (FormattingModel model, int offset) { Couple<Block> blockWithParent = getBlockAtOffset(null, model.getRootBlock(), offset); if (blockWithParent != null) { Block parentBlock = blockWithParent.first; Block targetBlock = blockWithParent.second; if (parentBlock != null && targetBlock != null) { Block prevBlock = findPreviousSibling(parentBlock, targetBlock); if (prevBlock != null) return (SpacingImpl)parentBlock.getSpacing(prevBlock, targetBlock); } } return null; }