1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 18:26:01 +02:00

Bug 344387 - Content assist get activated when it's not supposed to

This commit is contained in:
Anton Leherbauer 2011-05-02 07:57:02 +00:00
parent a23de8c133
commit f915813d3e

View file

@ -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;
}