forked from qt-creator/qt-creator
TextEditor: Make threshold for automatic completion configurable
Fixes: QTCREATORBUG-19920 Change-Id: Id6be79485b1fb8c2ab4cce2706816949ae5e217b Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -851,12 +851,12 @@ bool InternalCppCompletionAssistProcessor::accepts() const
|
||||
|
||||
return true;
|
||||
} else {
|
||||
// Trigger completion after three characters of a name have been typed, when not editing an existing name
|
||||
// Trigger completion after n characters of a name have been typed, when not editing an existing name
|
||||
QChar characterUnderCursor = m_interface->characterAt(pos);
|
||||
|
||||
if (!isValidIdentifierChar(characterUnderCursor)) {
|
||||
const int startOfName = findStartOfName(pos);
|
||||
if (pos - startOfName >= 3) {
|
||||
if (pos - startOfName >= TextEditorSettings::completionSettings().m_characterThreshold) {
|
||||
const QChar firstCharacter = m_interface->characterAt(startOfName);
|
||||
if (isValidFirstIdentifierChar(firstCharacter)) {
|
||||
// Finally check that we're not inside a comment or string (code copied from startOfOperator)
|
||||
|
||||
Reference in New Issue
Block a user