diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessContents.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessContents.java index f9f72e807b7..ee2fdc14dd9 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessContents.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessContents.java @@ -281,6 +281,16 @@ private void refreshTable(QuickAccessElement perfectMatch, List entries.length && table.getItemCount() - entries.length > 20) { table.removeAll(); } + int count = 0; + for (List list : entries) { + System.out.println("---"); //$NON-NLS-1$ + for (QuickAccessEntry entry : list) { + System.out.println(entry.getLabel()); + } + if (count++ >= 2) { + break; + } + } TableItem[] items = table.getItems(); int selectionIndex = -1; int index = 0; @@ -530,6 +540,14 @@ public IStatus runInUIThread(IProgressMonitor monitor) { QuickAccessEntry.MATCH_PERFECT))); } res.addAll(entriesPerProvider.values()); + + // if one category provides the same single entry like "previous", we can avoid + // showing the duplicate second list + if (res.size() >= 2 && res.get(0).size() == 1 && res.get(1).size() == 1 + && (res.get(0).get(0).element.equals(res.get(1).get(0).element))) { + res.remove(1); + } + return (List[]) res.toArray(new List[res.size()]); }