From b72a9dd2391680b7a9ed7c82c1cfefc7cef687e8 Mon Sep 17 00:00:00 2001 From: lemelisk Date: Tue, 14 Oct 2014 17:56:29 +0400 Subject: [PATCH] CppTools: Fix auto-indent for break in switch statement Change-Id: I954acb3acc1d7848517a079ffdd254b50052b67d Task-number: QTCREATORBUG-13155 Reviewed-by: Nikolai Kosjar --- src/plugins/cpptools/cppqtstyleindenter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/cpptools/cppqtstyleindenter.cpp b/src/plugins/cpptools/cppqtstyleindenter.cpp index 4b134127c4..4858d540fc 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")) -- GitLab