void (@NotNull AnActionEvent e) { final EditorWindow window = getEditorWindow(e); if (window != null) { if (window.hasClosedTabs()) { window.restoreClosedTab(); } return; } Project project = e.getProject(); if (project == null) return; List<VirtualFile> list = EditorHistoryManager.getInstance(project).getFileList(); if (!list.isEmpty()) { FileEditorManager.getInstance(project).openFile(list.get(list.size() - 1), true); } }