aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cpptools/cppqtstyleindenter.cpp
diff options
context:
space:
mode:
authorlemelisk <bev.lemelisk@gmail.com>2014-10-14 17:56:29 +0400
committerNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2014-11-04 16:18:31 +0100
commitb72a9dd2391680b7a9ed7c82c1cfefc7cef687e8 (patch)
tree16c6eb2c4788482c4a4c5787ab637457b3fb59e6 /src/plugins/cpptools/cppqtstyleindenter.cpp
parentde33b3affa6f77a28012798ae09aa02492c280e7 (diff)
CppTools: Fix auto-indent for break in switch statement
Change-Id: I954acb3acc1d7848517a079ffdd254b50052b67d Task-number: QTCREATORBUG-13155 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Diffstat (limited to 'src/plugins/cpptools/cppqtstyleindenter.cpp')
-rw-r--r--src/plugins/cpptools/cppqtstyleindenter.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppqtstyleindenter.cpp b/src/plugins/cpptools/cppqtstyleindenter.cpp
index 4b134127c4e..4858d540fc9 100644
--- a/src/plugins/cpptools/cppqtstyleindenter.cpp
+++ b/src/plugins/cpptools/cppqtstyleindenter.cpp
@@ -61,6 +61,7 @@ bool CppQtStyleIndenter::isElectricCharacter(const QChar &ch) const
case '#':
case '<':
case '>':
+ case ';':
return true;
}
return false;
@@ -69,6 +70,8 @@ bool CppQtStyleIndenter::isElectricCharacter(const QChar &ch) const
static bool isElectricInLine(const QChar ch, const QString &text)
{
switch (ch.toLatin1()) {
+ case ';':
+ return text.contains(QLatin1String("break"));
case ':':
// switch cases and access declarations should be reindented
if (text.contains(QLatin1String("case"))