boolean (@NotNull final PsiFile file, @NotNull String text, int caretOffset) { final boolean useTabs = PyIndentUtil.areTabsUsedForIndentation(file); final PsiElement nonWS = PyUtil.findNextAtOffset(file, caretOffset, PsiWhiteSpace.class); if (nonWS == null || text.endsWith("\n")) { return true; } if (inStatementList(file, caretOffset) && (text.startsWith(useTabs ? "\t" : " ") || StringUtil.split(text, "\n").size() > 1)) { return true; } return false; }