aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/completionsettings.cpp
diff options
context:
space:
mode:
authorJoel Smith <joel.m.smith@gmail.com>2019-05-15 21:50:28 -0700
committerJoel Smith <joel.m.smith@gmail.com>2019-05-27 14:09:12 +0000
commite846b8717aad09e71650c6ca95b05d320f1eb3f1 (patch)
tree818bc7e5fb6cfa9ff754b75eb7057d7e36e8b00d /src/plugins/texteditor/completionsettings.cpp
parent0980484be856a71d704bad7623d0b6c5abff143e (diff)
TextEditor: Type over punctuation that can be auto completed
This restores a feature of older Qt Creator versions: typing "over" closing punctuation. For instance, if my cursor is at | and I have something like this: if (statement|) ... and I type the ) character, older versions of Qt Creator would not end up with )). With newer versions of Qt Creator, this behavior is limited to the case where an autocompletion has just happened (i.e. if I typed the opening ( character, the closing ) is auto inserted and highlighted - and if I type it myself, it won't add a second one). Task-number: QTCREATORBUG-16946 Change-Id: I45af3ac139d5e7c76e5f0a8a9d66762f9209a525 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: David Schulz <david.schulz@qt.io>
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 61c9f203a8..aca84ef104 100644
--- a/src/plugins/texteditor/completionsettings.cpp
+++ b/src/plugins/texteditor/completionsettings.cpp
@@ -42,6 +42,7 @@ static const char animateAutoCompleteKey[] = "AnimateAutoComplete";
static const char highlightAutoCompleteKey[] = "HighlightAutoComplete";
static const char skipAutoCompleteKey[] = "SkipAutoComplete";
static const char autoRemoveKey[] = "AutoRemove";
+static const char overwriteClosingCharsKey[] = "OverwriteClosingChars";
using namespace TextEditor;
@@ -62,6 +63,7 @@ void CompletionSettings::toSettings(QSettings *s) const
s->setValue(highlightAutoCompleteKey, m_highlightAutoComplete);
s->setValue(skipAutoCompleteKey, m_skipAutoCompletedText);
s->setValue(autoRemoveKey, m_autoRemove);
+ s->setValue(overwriteClosingCharsKey, m_overwriteClosingChars);
s->endGroup();
}
@@ -98,6 +100,8 @@ void CompletionSettings::fromSettings(QSettings *s)
s->value(skipAutoCompleteKey, m_skipAutoCompletedText).toBool();
m_autoRemove =
s->value(autoRemoveKey, m_autoRemove).toBool();
+ m_overwriteClosingChars =
+ s->value(overwriteClosingCharsKey, m_overwriteClosingChars).toBool();
s->endGroup();
}
@@ -117,5 +121,6 @@ bool CompletionSettings::equals(const CompletionSettings &cs) const
&& m_highlightAutoComplete == cs.m_highlightAutoComplete
&& m_skipAutoCompletedText == cs.m_skipAutoCompletedText
&& m_autoRemove == cs.m_autoRemove
+ && m_overwriteClosingChars == cs.m_overwriteClosingChars
;
}