boolean (@NotNull final Project project, @NotNull final Editor editor, @NotNull final PsiFile psiFile) { final Document document = editor.getDocument(); final String textForRollBack = document.getText(); final int offset = editor.getCaretModel().getOffset(); try { editor.putUserData(SMART_ENTER_TIMESTAMP, editor.getDocument().getModificationStamp()); myFirstErrorOffset = Integer.MAX_VALUE; process(project, editor, psiFile, 0); } catch (TooManyAttemptsException e) { LOG.info(e); document.replaceString(0, document.getTextLength(), textForRollBack); editor.getCaretModel().moveToOffset(offset); } finally { editor.putUserData(SMART_ENTER_TIMESTAMP, null); } return true; }