diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemCommandsView.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemCommandsView.java index 1c40d0cc462..feb3b56dc6d 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemCommandsView.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemCommandsView.java @@ -190,10 +190,10 @@ public class SystemCommandsView extends SystemTableView implements ISystemThemeC } } } - if (index > 0) - { - table.setTopIndex(index - 1); - } + int y = table.getSize().y; + int h = table.getItemHeight(); + int n = y / h - 1; + table.setTopIndex(Math.max(0, index - n)); } } if (needsLayout)