boolean () { final FileDocumentManager documentManager = FileDocumentManager.getInstance(); return !myEditorManager.containsUnsavedDocuments() || autoSaveDocuments() || LightEditUtil.confirmClose( ApplicationBundle.message("light.edit.exit.message"), ApplicationBundle.message("light.edit.exit.title"), new LightEditSaveConfirmationHandler() { @Override public void onSave() { documentManager.saveAllDocuments(); } @Override public void onDiscard() { myEditorManager.getUnsavedEditors().forEach(editorInfo -> { VirtualFile file = editorInfo.getFile(); Document document = documentManager.getDocument(file); if (document != null) { documentManager.reloadFromDisk(document); } }); } } ); }