void (@NotNull Editor editor, @NotNull Project project) { if (ContainerUtil.getFirstItem(editor.getCaretModel().getAllCarets()) != editor.getCaretModel().getCurrentCaret()) { PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument()); } }