private static SpacingImpl getSpacingBeforeBlockAtOffset(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;
  }
private static SpacingImpl getSpacingBeforeBlockAtOffset(FormattingModel model, int offset)