mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 18:56:02 +02:00
Bug 344387 - Content assist get activated when it's not supposed to
This commit is contained in:
parent
a23de8c133
commit
f915813d3e
1 changed files with 8 additions and 9 deletions
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* 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;
|
return context;
|
||||||
|
@ -311,21 +316,15 @@ public class CContentAssistProcessor extends ContentAssistProcessor {
|
||||||
try {
|
try {
|
||||||
doc.replace(offset - 1, 1, "->"); //$NON-NLS-1$
|
doc.replace(offset - 1, 1, "->"); //$NON-NLS-1$
|
||||||
context.dispose();
|
context.dispose();
|
||||||
|
context = null;
|
||||||
// if user turned on activation only for replacement characters,
|
// if user turned on activation only for replacement characters,
|
||||||
// setting the context to null will skip the proposals popup later
|
// setting the context to null will skip the proposals popup later
|
||||||
if (!isAutoActivated() || fCContentAutoActivationCharacters.contains(activationChar)) {
|
if (!isAutoActivated() || fCContentAutoActivationCharacters.contains(activationChar)) {
|
||||||
context = new CContentAssistInvocationContext(viewer, offset + 1, fEditor,
|
context = new CContentAssistInvocationContext(viewer, offset + 1, fEditor,
|
||||||
isCompletion, isAutoActivated());
|
isCompletion, isAutoActivated());
|
||||||
} else {
|
|
||||||
context = null;
|
|
||||||
}
|
}
|
||||||
} catch (BadLocationException e) {
|
} catch (BadLocationException e) {
|
||||||
if (isAutoActivated() && !fCContentAutoActivationCharacters.contains(activationChar)) {
|
// ignore
|
||||||
if (context != null) {
|
|
||||||
context.dispose(); // XXX dang false positives null deref warnings
|
|
||||||
context = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue