int (@NotNull String text, int start) { int indent = 0; for (int i = start; i < text.length(); i++) { char c = text.charAt(i); if (c == '\n') { indent = 0; continue; } if (Character.isWhitespace(c)) { indent++; continue; } return indent; } return -1; }