Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAnton Leherbauer2011-05-02 07:57:02 +0000
committerAnton Leherbauer2011-05-02 07:57:02 +0000
commitf915813d3e46dc1eb34a361613c3534b06b45a6f (patch)
tree5ab4dafd60b1573ad9d8bb71fc2e6f1eb16b4621 /core
parenta23de8c1330347b2ac2783ba171cd3c0fe2c0be5 (diff)
downloadorg.eclipse.cdt-f915813d3e46dc1eb34a361613c3534b06b45a6f.tar.gz
org.eclipse.cdt-f915813d3e46dc1eb34a361613c3534b06b45a6f.tar.xz
org.eclipse.cdt-f915813d3e46dc1eb34a361613c3534b06b45a6f.zip
Bug 344387 - Content assist get activated when it's not supposed to
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CContentAssistProcessor.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CContentAssistProcessor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CContentAssistProcessor.java
index 1734799767e..1d6e057cfe7 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CContentAssistProcessor.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CContentAssistProcessor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 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
@@ -300,6 +300,11 @@ public class CContentAssistProcessor extends ContentAssistProcessor {
}
}
}
+ if (context != null && isAutoActivated() && !fCContentAutoActivationCharacters.contains(activationChar)) {
+ // auto-replace, but not auto-content-assist - bug 344387
+ context.dispose();
+ context = null;
+ }
}
return context;
@@ -311,21 +316,15 @@ public class CContentAssistProcessor extends ContentAssistProcessor {
try {
doc.replace(offset - 1, 1, "->"); //$NON-NLS-1$
context.dispose();
+ context = null;
// if user turned on activation only for replacement characters,
// setting the context to null will skip the proposals popup later
if (!isAutoActivated() || fCContentAutoActivationCharacters.contains(activationChar)) {
context = new CContentAssistInvocationContext(viewer, offset + 1, fEditor,
isCompletion, isAutoActivated());
- } else {
- context = null;
}
} catch (BadLocationException e) {
- if (isAutoActivated() && !fCContentAutoActivationCharacters.contains(activationChar)) {
- if (context != null) {
- context.dispose(); // XXX dang false positives null deref warnings
- context = null;
- }
- }
+ // ignore
}
return context;
}

Back to the top