mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
recent files fixes
This commit is contained in:
@@ -35,7 +35,7 @@ public class ShowRecentFilesAction extends DumbAwareAction {
|
||||
final Project project = e.getData(PlatformDataKeys.PROJECT);
|
||||
if (project != null) {
|
||||
FeatureUsageTracker.getInstance().triggerFeatureUsed("navigation.recent.files");
|
||||
Switcher.createAndShowSwitcher(project, IdeBundle.message("title.popup.recent.files"), true);
|
||||
Switcher.createAndShowSwitcher(project, IdeBundle.message("title.popup.recent.files"), true).goForward();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ public class Switcher extends AnAction implements DumbAware {
|
||||
SwitcherPanel(Project project, String title, boolean pinned) {
|
||||
super(new BorderLayout(0, 0));
|
||||
this.project = project;
|
||||
MAX_FILES_IN_SWITCHER = pinned ? UISettings.getInstance().RECENT_FILES_LIMIT + UISettings.getInstance().EDITOR_TAB_LIMIT : 30;
|
||||
MAX_FILES_IN_SWITCHER = pinned ? UISettings.getInstance().RECENT_FILES_LIMIT : 30;
|
||||
myPinned = pinned;
|
||||
mySpeedSearch = pinned ? new SwitcherSpeedSearch() : null;
|
||||
|
||||
@@ -297,8 +297,10 @@ public class Switcher extends AnAction implements DumbAware {
|
||||
final FileEditorManagerImpl editorManager = (FileEditorManagerImpl)FileEditorManager.getInstance(project);
|
||||
final ArrayList<FileInfo> filesData = new ArrayList<FileInfo>();
|
||||
final ArrayList<FileInfo> editors = new ArrayList<FileInfo>();
|
||||
for (Pair<VirtualFile, EditorWindow> pair : editorManager.getSelectionHistory()) {
|
||||
editors.add(new FileInfo(pair.first, pair.second));
|
||||
if (!pinned) {
|
||||
for (Pair<VirtualFile, EditorWindow> pair : editorManager.getSelectionHistory()) {
|
||||
editors.add(new FileInfo(pair.first, pair.second));
|
||||
}
|
||||
}
|
||||
if (editors.size() < 2 || isPinnedMode()) {
|
||||
if (isPinnedMode() && editors.size() > 1) {
|
||||
@@ -306,7 +308,7 @@ public class Switcher extends AnAction implements DumbAware {
|
||||
}
|
||||
final VirtualFile[] recentFiles = ArrayUtil.reverseArray(EditorHistoryManager.getInstance(project).getFiles());
|
||||
final int maxFiles = Math.max(editors.size(), recentFiles.length);
|
||||
final int len = isPinnedMode() ? maxFiles : Math.min(toolWindows.getModel().getSize(), maxFiles);
|
||||
final int len = isPinnedMode() ? recentFiles.length : Math.min(toolWindows.getModel().getSize(), maxFiles);
|
||||
boolean firstRecentMarked = false;
|
||||
for (int i = 0; i < len; i++) {
|
||||
final FileInfo info = new FileInfo(recentFiles[i], null);
|
||||
|
||||
Reference in New Issue
Block a user