aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/glsleditor
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2020-08-03 16:19:19 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2020-08-13 13:49:44 +0000
commit760d91665f7fb89b2f1ecdbc5203f06d323b41f0 (patch)
treea890ae3981e984bbe983f7bebe729ec2da6131c6 /src/plugins/glsleditor
parent7576ead1ddc4fa863cb7856dbb569cdfb7c4e89b (diff)
TextEditor: Make threshold for automatic completion configurable
Fixes: QTCREATORBUG-19920 Change-Id: Id6be79485b1fb8c2ab4cce2706816949ae5e217b Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/glsleditor')
-rw-r--r--src/plugins/glsleditor/glslcompletionassist.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/glsleditor/glslcompletionassist.cpp b/src/plugins/glsleditor/glslcompletionassist.cpp
index 69802b7470..ef86585051 100644
--- a/src/plugins/glsleditor/glslcompletionassist.cpp
+++ b/src/plugins/glsleditor/glslcompletionassist.cpp
@@ -40,6 +40,7 @@
#include <texteditor/codeassist/genericproposalmodel.h>
#include <texteditor/codeassist/genericproposal.h>
#include <texteditor/codeassist/functionhintproposal.h>
+#include <texteditor/texteditorsettings.h>
#include <cplusplus/ExpressionUnderCursor.h>
#include <cplusplus/Icons.h>
@@ -528,7 +529,8 @@ bool GlslCompletionAssistProcessor::acceptsIdleEditor() const
++pos;
const QString word = m_interface->textAt(pos, cursorPosition - pos);
- if (word.length() > 2 && checkStartOfIdentifier(word)) {
+ if (word.length() >= TextEditorSettings::completionSettings().m_characterThreshold
+ && checkStartOfIdentifier(word)) {
for (auto character : word) {
if (!isIdentifierChar(character))
return false;