Skip to content

Commit 2443079

Browse files
committed
Auto select subpackages in the quick outline.
1 parent 4d509fa commit 2443079

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

rpm/org.eclipse.linuxtools.rpm.ui.editor/src/org/eclipse/linuxtools/rpm/ui/editor/outline/SpecfileQuickOutlineDialog.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ private void stringMatcherUpdated() {
114114
treeViewer.getControl().setRedraw(false);
115115
treeViewer.refresh();
116116
treeViewer.expandAll();
117-
treeViewer.getTree().select(treeViewer.getTree().getItem(0));
117+
if(treeViewer.getTree().getTopItem() != null && treeViewer.getTree().getTopItem().getItemCount() > 0) {
118+
treeViewer.getTree().select(treeViewer.getTree().getTopItem().getItem(0));
119+
} else if(treeViewer.getTree().getItemCount()>0) {
120+
treeViewer.getTree().select(treeViewer.getTree().getItem(0));
121+
}
118122
treeViewer.getControl().setRedraw(true);
119123
}
120124

0 commit comments

Comments
 (0)