void (final @NotNull AnActionEvent event) { final DataContext dataContext = event.getDataContext(); final VirtualFile vFile = CommonDataKeys.VIRTUAL_FILE.getData(dataContext); final Project project = CommonDataKeys.PROJECT.getData(dataContext); if (vFile == null || project == null) { return; } EditorWindow window = EditorWindow.DATA_KEY.getData(dataContext); if (window == null) { return; } List<EditorWindow> siblings = window.getSiblings(); if (siblings.size() == 1) { EditorComposite editorComposite = window.getSelectedComposite(); HistoryEntry entry = editorComposite.currentStateAsHistoryEntry$intellij_platform_ide_impl(); vFile.putUserData(FileEditorManagerImpl.CLOSING_TO_REOPEN, Boolean.TRUE); if (myCloseSource) { window.closeFile(vFile, true, false); } ((FileEditorManagerImpl)FileEditorManagerEx.getInstanceEx(project)).openMaybeInvalidFile$intellij_platform_ide_impl(siblings.get(0), vFile, entry); vFile.putUserData(FileEditorManagerImpl.CLOSING_TO_REOPEN, null); } }