Result (char character, @NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file, @NotNull FileType fileType) { if (!(fileType instanceof PythonFileType)) return Result.CONTINUE; // else we'd mess up with other file types! if (character == ':') { final Document document = editor.getDocument(); final int offset = editor.getCaretModel().getOffset(); if (offset < document.getTextLength() && document.getCharsSequence().charAt(offset) == ':') { PsiDocumentManager.getInstance(project).commitDocument(document); Result res = getOverTypeResult(editor, file); if (res == Result.STOP) { return res; } } PyUnindentingInsertHandler.unindentAsNeeded(project, editor, file); } return Result.CONTINUE; // the default }