void (Template template) { try { PsiDocumentManager documentManager = PsiDocumentManager.getInstance(myProject); documentManager.commitAllDocuments(); finish(false); moveOffsetAfter(false); } finally { FinishMarkAction.finish(myProject, myEditor, myMarkAction); } }