private static boolean isLeadingSpace(@NotNull CharSequence text, int start) {
    if (start < 0) return false;
    if (start == text.length()) return false;
    if (!isWhiteSpace(text.charAt(start))) return false;

    start--;
    while (start >= 0) {
      char c = text.charAt(start);
      if (c == '\n') return true;
      if (!isWhiteSpace(c)) return false;
      start--;
    }
    return true;
  }
private static boolean isLeadingSpace(@NotNull CharSequence text, int start)