forked from qt-creator/qt-creator
CppTools: Fix auto-indent for break in switch statement
Change-Id: I954acb3acc1d7848517a079ffdd254b50052b67d Task-number: QTCREATORBUG-13155 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
@@ -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
|
|||||||
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"))
|
||||||
|
|||||||
Reference in New Issue
Block a user