public static CharSequence getIndent(@NotNull Document document, int offset) {
    int lineOffset = getLineStartOffset(offset, document);
    return document.getCharsSequence().subSequence(lineOffset, lineOffset + getIndentLengthAtLineStart(document, lineOffset));
  }
public static CharSequence getIndent(@NotNull Document document, int offset)