aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/completionsettings.cpp
diff options
context:
space:
mode:
authorFrancois Ferrand <thetypz@gmail.com>2014-09-29 18:19:38 +0200
committerhjk <hjk121@nokiamail.com>2014-10-15 15:59:18 +0200
commit32b960db47f73838a3955fd50bc71b7a030766fa (patch)
tree2a02534d6731c9db01dde8ce7f1e2c82a8df0782 /src/plugins/texteditor/completionsettings.cpp
parent82d9cf4146d47f1ac31c408a6b84083930b5a495 (diff)
C++: support smart splitting of strings.
If 'enter' is pressed while the cursor is in the middle of a string, the string is ended at the current cursor position, and a new string is started on the next line. This makes it very easy to split a long string onto multiple lines. In addition, Shift+Enter insert an escape in the string, to continue the string at the beginning of next line. A setting can be used to enable or disable this option. Change-Id: Ia5f3c6989fc00d40d06bc4fe1182fe8b1318f565 Reviewed-by: Francois Ferrand <thetypz@gmail.com> Reviewed-by: hjk <hjk121@nokiamail.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 a42ef47122..f38dcabae2 100644
--- a/src/plugins/texteditor/completionsettings.cpp
+++ b/src/plugins/texteditor/completionsettings.cpp
@@ -39,6 +39,7 @@ static const char autoInsertBracesKey[] = "AutoInsertBraces";
static const char surroundingAutoBracketsKey[] = "SurroundingAutoBrackets";
static const char partiallyCompleteKey[] = "PartiallyComplete";
static const char spaceAfterFunctionNameKey[] = "SpaceAfterFunctionName";
+static const char autoSplitStringsKey[] = "AutoSplitStrings";
using namespace TextEditor;
@@ -49,6 +50,7 @@ CompletionSettings::CompletionSettings()
, m_surroundingAutoBrackets(true)
, m_partiallyComplete(true)
, m_spaceAfterFunctionName(false)
+ , m_autoSplitStrings(true)
{
}
@@ -65,6 +67,7 @@ void CompletionSettings::toSettings(const QString &category, QSettings *s) const
s->setValue(QLatin1String(surroundingAutoBracketsKey), m_surroundingAutoBrackets);
s->setValue(QLatin1String(partiallyCompleteKey), m_partiallyComplete);
s->setValue(QLatin1String(spaceAfterFunctionNameKey), m_spaceAfterFunctionName);
+ s->setValue(QLatin1String(autoSplitStringsKey), m_autoSplitStrings);
s->endGroup();
}
@@ -83,6 +86,7 @@ void CompletionSettings::fromSettings(const QString &category, const QSettings *
m_surroundingAutoBrackets = s->value(group + QLatin1String(surroundingAutoBracketsKey), m_surroundingAutoBrackets).toBool();
m_partiallyComplete = s->value(group + QLatin1String(partiallyCompleteKey), m_partiallyComplete).toBool();
m_spaceAfterFunctionName = s->value(group + QLatin1String(spaceAfterFunctionNameKey), m_spaceAfterFunctionName).toBool();
+ m_autoSplitStrings = s->value(group + QLatin1String(autoSplitStringsKey), m_autoSplitStrings).toBool();
}
bool CompletionSettings::equals(const CompletionSettings &cs) const
@@ -93,5 +97,6 @@ bool CompletionSettings::equals(const CompletionSettings &cs) const
&& m_surroundingAutoBrackets == cs.m_surroundingAutoBrackets
&& m_partiallyComplete == cs.m_partiallyComplete
&& m_spaceAfterFunctionName == cs.m_spaceAfterFunctionName
+ && m_autoSplitStrings == cs.m_autoSplitStrings
;
}