Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2019-09-20 06:29:35 -0400
committerThomas Wolf2019-09-20 06:29:35 -0400
commit4baf61475034ce23da5fe9ef367ef4958cf4a717 (patch)
tree2e96b9584dbbec0729de0a9ad3d915be71d0b80a /org.eclipse.egit.ui
parent2a612f543bd2ca7ca057a4855687f91e6f0b260f (diff)
downloadegit-4baf61475034ce23da5fe9ef367ef4958cf4a717.tar.gz
egit-4baf61475034ce23da5fe9ef367ef4958cf4a717.tar.xz
egit-4baf61475034ce23da5fe9ef367ef4958cf4a717.zip
[history] Clear selection before clearing commit table
Similar to CommitFileDiffViewer. Otherwise the viewer may spend time trying to restore a previously existing selection after the input has changed in StructuredViewer.preservingSelecction(), but when we clear the viewer anyway we know that there won't be anything to restore. Change-Id: I9305d3b03f8e3102f2ecae8d6f729fa1741fce04 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.egit.ui')
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
index cfa847f0c..dd89b368f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
@@ -124,6 +124,7 @@ import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jgit.annotations.NonNull;
import org.eclipse.jgit.diff.DiffConfig;
@@ -1972,9 +1973,8 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
private void clearViewers() {
TableViewer viewer = graph.getTableView();
+ viewer.setSelection(StructuredSelection.EMPTY);
viewer.setInput(new SWTCommit[0]);
- // Force a selection changed event
- viewer.setSelection(viewer.getSelection());
}
@Override

Back to the top