void (final @NotNull LocalHistoryFacade vcs) { ApplicationManager.getApplication().runReadAction(() -> { vcs.beginChangeSet(); for (Document d : FileDocumentManager.getInstance().getUnsavedDocuments()) { VirtualFile f = getFile(d); if (!shouldRegisterDocument(f)) continue; registerDocumentContents(vcs, f, d); } vcs.endChangeSet(null); }); }