Commit b72a9dd2 authored by lemelisk's avatar lemelisk Committed by Nikolai Kosjar

CppTools: Fix auto-indent for break in switch statement

Change-Id: I954acb3acc1d7848517a079ffdd254b50052b67d
Task-number: QTCREATORBUG-13155
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent de33b3af
...@@ -61,6 +61,7 @@ bool CppQtStyleIndenter::isElectricCharacter(const QChar &ch) const ...@@ -61,6 +61,7 @@ bool CppQtStyleIndenter::isElectricCharacter(const QChar &ch) const
case '#': case '#':
case '<': case '<':
case '>': case '>':
case ';':
return true; return true;
} }
return false; return false;
...@@ -69,6 +70,8 @@ bool CppQtStyleIndenter::isElectricCharacter(const QChar &ch) const ...@@ -69,6 +70,8 @@ bool CppQtStyleIndenter::isElectricCharacter(const QChar &ch) const
static bool isElectricInLine(const QChar ch, const QString &text) static bool isElectricInLine(const QChar ch, const QString &text)
{ {
switch (ch.toLatin1()) { switch (ch.toLatin1()) {
case ';':
return text.contains(QLatin1String("break"));
case ':': case ':':
// switch cases and access declarations should be reindented // switch cases and access declarations should be reindented
if (text.contains(QLatin1String("case")) if (text.contains(QLatin1String("case"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment