aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/completionsettings.cpp
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2016-06-10 15:13:38 +0200
committerDavid Schulz <david.schulz@theqtcompany.com>2016-06-21 11:56:56 +0000
commit675060724453fc2a5d12431b656fdbb599e529f6 (patch)
treecbf5a1fc06919089d4028bd31c6ae7e15ee575b6 /src/plugins/texteditor/completionsettings.cpp
parent08dcad9c829abfbc592d6a4628d091d942a87c0f (diff)
Editor: Skip auto completed character only if it was recently inserted.
This means you can skip automatically inserted characters as long as you don't explicitly move the text cursor and the editor doesn't lose the focus. This will be visualized by highlighting the automatically inserted character as long as you can perform the skipping. This will reduce unexpected skipping in the case a cursor was explicitly placed before an closing brace and a closing brace is typed. Change-Id: I28e29e79ba10c9c48e8bc8817405fea630cca9bd Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Diffstat (limited to 'src/plugins/texteditor/completionsettings.cpp')
-rw-r--r--src/plugins/texteditor/completionsettings.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/texteditor/completionsettings.cpp b/src/plugins/texteditor/completionsettings.cpp
index 8bdcbded95..a012e407c2 100644
--- a/src/plugins/texteditor/completionsettings.cpp
+++ b/src/plugins/texteditor/completionsettings.cpp
@@ -40,6 +40,7 @@ static const char spaceAfterFunctionNameKey[] = "SpaceAfterFunctionName";
static const char autoSplitStringsKey[] = "AutoSplitStrings";
static const char animateAutoCompleteKey[] = "AnimateAutoComplete";
static const char highlightAutoCompleteKey[] = "HighlightAutoComplete";
+static const char skipAutoCompleteKey[] = "SkipAutoComplete";
using namespace TextEditor;
@@ -58,6 +59,7 @@ void CompletionSettings::toSettings(QSettings *s) const
s->setValue(autoSplitStringsKey, m_autoSplitStrings);
s->setValue(animateAutoCompleteKey, m_animateAutoComplete);
s->setValue(highlightAutoCompleteKey, m_highlightAutoComplete);
+ s->setValue(skipAutoCompleteKey, m_skipAutoCompletedText);
s->endGroup();
}
@@ -90,6 +92,8 @@ void CompletionSettings::fromSettings(QSettings *s)
s->value(animateAutoCompleteKey, m_animateAutoComplete).toBool();
m_highlightAutoComplete =
s->value(highlightAutoCompleteKey, m_highlightAutoComplete).toBool();
+ m_skipAutoCompletedText =
+ s->value(skipAutoCompleteKey, m_skipAutoCompletedText).toBool();
s->endGroup();
}
@@ -107,5 +111,6 @@ bool CompletionSettings::equals(const CompletionSettings &cs) const
&& m_autoSplitStrings == cs.m_autoSplitStrings
&& m_animateAutoComplete == cs.m_animateAutoComplete
&& m_highlightAutoComplete == cs.m_highlightAutoComplete
+ && m_skipAutoCompletedText == cs.m_skipAutoCompletedText
;
}