Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2017-02-13 14:40:02 +0000
committerDani Megert2017-02-13 14:40:02 +0000
commit4a2752b8f7bfb91b9c49bd7e47625e1a5a3a38e5 (patch)
tree778de2fdafdd5dae6e7f3aa641a2c43e48384fad
parent4718faadfe79f08468abfbb2b350bfd084065684 (diff)
downloadeclipse.platform.text-4a2752b8f7bfb91b9c49bd7e47625e1a5a3a38e5.tar.gz
eclipse.platform.text-4a2752b8f7bfb91b9c49bd7e47625e1a5a3a38e5.tar.xz
eclipse.platform.text-4a2752b8f7bfb91b9c49bd7e47625e1a5a3a38e5.zip
Fixed bug 511542: [content assist] Incorrect default selection in proposals list after filteringY20170216-1000I20170216-0140I20170215-2000I20170214-2200I20170214-2000I20170213-2000
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java14
1 files changed, 5 insertions, 9 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
index 7bc89a9cfef..a9d8b665292 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -1151,6 +1151,9 @@ class CompletionProposalPopup implements IContentAssistListener {
return;
if (Helper.okToUse(fProposalTable)) {
+ if (oldProposal instanceof ICompletionProposalExtension2 && fViewer != null)
+ ((ICompletionProposalExtension2) oldProposal).unselected(fViewer);
+
if (proposals == null || proposals.isEmpty()) {
fEmptyProposal.fOffset= fFilterOffset;
fEmptyProposal.fDisplayString= fEmptyMessage != null ? fEmptyMessage : JFaceTextMessages.getString("CompletionProposalPopup.no_proposals"); //$NON-NLS-1$
@@ -1163,13 +1166,6 @@ class CompletionProposalPopup implements IContentAssistListener {
fIsInitialSort= false;
fFilteredProposals= proposals;
- int index = fFilteredProposals.indexOf(oldProposal);
- if (index == -1) {
- index = 0;
- if (oldProposal instanceof ICompletionProposalExtension2 && fViewer != null) {
- ((ICompletionProposalExtension2) oldProposal).unselected(fViewer);
- }
- }
final int newLen= proposals.size();
fProposalTable.clearAll();
@@ -1180,7 +1176,7 @@ class CompletionProposalPopup implements IContentAssistListener {
if ((newLocation.x < currentLocation.x && newLocation.y == currentLocation.y) || newLocation.y < currentLocation.y)
fProposalShell.setLocation(newLocation);
- selectProposal(index, false);
+ selectProposal(0, false);
}
}

Back to the top