forked from qt-creator/qt-creator
Delay the automatic completion.
This commit is contained in:
@@ -658,7 +658,7 @@ bool CppCodeCompletion::triggersCompletion(TextEditor::ITextEditable *editor)
|
||||
QChar characterUnderCursor = editor->characterAt(pos);
|
||||
if (!characterUnderCursor.isLetterOrNumber()) {
|
||||
const int startOfName = findStartOfName(pos);
|
||||
if (pos - startOfName == 3) {
|
||||
if (pos - startOfName >= 3) {
|
||||
const QChar firstCharacter = editor->characterAt(startOfName);
|
||||
if (firstCharacter.isLetter() || firstCharacter == QLatin1Char('_')) {
|
||||
// Finally check that we're not inside a comment or string (code copied from startOfOperator)
|
||||
@@ -1725,6 +1725,11 @@ void CppCodeCompletion::completions(QList<TextEditor::CompletionItem> *completio
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (completions->size() == 1) {
|
||||
if (key == completions->first().text)
|
||||
completions->clear();
|
||||
}
|
||||
}
|
||||
|
||||
QList<TextEditor::CompletionItem> CppCodeCompletion::removeDuplicates(const QList<TextEditor::CompletionItem> &items)
|
||||
|
||||
Reference in New Issue
Block a user