Added option to disable completion of common prefix

Some people don't like this.
This commit is contained in:
Thorbjørn Lindeijer
2008-12-16 16:55:44 +01:00
parent e19c940d37
commit 9cf4074504
5 changed files with 30 additions and 2 deletions

View File

@@ -346,6 +346,16 @@ void CppCodeCompletion::setAutoInsertBraces(bool autoInsertBraces)
m_autoInsertBraces = autoInsertBraces;
}
bool CppCodeCompletion::isPartialCompletionEnabled() const
{
return m_partialCompletionEnabled;
}
void CppCodeCompletion::setPartialCompletionEnabled(bool partialCompletionEnabled)
{
m_partialCompletionEnabled = partialCompletionEnabled;
}
/*
Searches beckward for an access operator.
*/
@@ -1030,7 +1040,7 @@ bool CppCodeCompletion::partiallyComplete(const QList<TextEditor::CompletionItem
} else if (completionItems.count() == 1) {
complete(completionItems.first());
return true;
} else if (m_completionOperator != T_LPAREN) {
} else if (m_partialCompletionEnabled && m_completionOperator != T_LPAREN) {
// Compute common prefix
QString firstKey = completionItems.first().m_text;
QString lastKey = completionItems.last().m_text;