void (@NotNull Document document) { myBlankLinesBefore = 0; int lineFeeds = 0; CharSequence text = document.getCharsSequence(); for (int current = getStartOffset() - 1; current >= 0; current--) { current = CharArrayUtil.shiftBackward(text, current, " \t"); if (current > 0 && text.charAt(current) == '\n') lineFeeds++; else break; } if (lineFeeds > 0) myBlankLinesBefore = lineFeeds - 1; }