mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-104706 Remove currently active file from "Recent Files" popup
This commit is contained in:
@@ -23,7 +23,6 @@ import com.intellij.featureStatistics.FeatureUsageTracker;
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx;
|
||||
import com.intellij.openapi.project.DumbAwareAction;
|
||||
import com.intellij.openapi.project.Project;
|
||||
|
||||
@@ -36,10 +35,7 @@ public class ShowRecentFilesAction extends DumbAwareAction {
|
||||
final Project project = e.getData(CommonDataKeys.PROJECT);
|
||||
if (project != null) {
|
||||
FeatureUsageTracker.getInstance().triggerFeatureUsed("navigation.recent.files");
|
||||
final Switcher.SwitcherPanel switcher = Switcher.createAndShowSwitcher(project, IdeBundle.message("title.popup.recent.files"), true);
|
||||
if (FileEditorManagerEx.getInstanceEx(project).hasOpenedFile()) {
|
||||
switcher.goForward();
|
||||
}
|
||||
Switcher.createAndShowSwitcher(project, IdeBundle.message("title.popup.recent.files"), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,7 +345,12 @@ public class Switcher extends AnAction implements DumbAware {
|
||||
final int maxFiles = Math.max(editors.size(), recentFiles.length);
|
||||
final int len = isPinnedMode() ? recentFiles.length : Math.min(toolWindows.getModel().getSize(), maxFiles);
|
||||
boolean firstRecentMarked = false;
|
||||
final List<VirtualFile> selectedFiles = Arrays.asList(editorManager.getSelectedFiles());
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (isPinnedMode() && selectedFiles.contains(recentFiles[i])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
final FileInfo info = new FileInfo(recentFiles[i], null);
|
||||
boolean add = true;
|
||||
if (isPinnedMode()) {
|
||||
|
||||
Reference in New Issue
Block a user