private boolean isStartingNewLine(Block block) {
    TextRange range = block.getTextRange();
    int blockStart = range.getStartOffset();

    int lineNumber = myDocument.getLineNumber(blockStart);
    int lineStartOffset = myDocument.getLineStartOffset(lineNumber);

    CharSequence text = myDocument.getCharsSequence();
    return CharArrayUtil.isEmptyOrSpaces(text, lineStartOffset, blockStart);
  }
private boolean isStartingNewLine(Block block)