boolean (@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) { int offset = editor.getCaretModel().getOffset() - 1; if (offset >= 0) { Document document = editor.getDocument(); int line = document.getLineNumber(offset); int lineStart = document.getLineStartOffset(line); if (StringUtil.isEmptyOrSpaces(document.getCharsSequence().subSequence(lineStart, offset))) { PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument()); CodeStyleManager.getInstance(project).adjustLineIndent(file, offset); return true; } } return false; }