diff options
author | Marco Benelli <marco.benelli@qt.io> | 2017-09-06 11:55:48 +0200 |
---|---|---|
committer | Marco Benelli <marco.benelli@qt.io> | 2017-09-19 08:04:50 +0000 |
commit | d600bae7360f483f0a12f9cfde78a258d42d87de (patch) | |
tree | 27870549f9314f92106295df96c0e9b79bd432ba | |
parent | 65b2edbd82dffe5ea13dbce299baa80109cfdf1f (diff) | |
download | qt-creator-d600bae7360f483f0a12f9cfde78a258d42d87de.tar.gz |
QmlJs: better indentation for switch common cases
Do not add an empty line between common cases in a `switch` block,
according the best practices for javascript style.
Task-number: QTCREATORBUG-18515
Change-Id: I8b665eabb9b1d5b617d608e430e8b9137dc32032
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r-- | src/libs/qmljs/qmljsreformatter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libs/qmljs/qmljsreformatter.cpp b/src/libs/qmljs/qmljsreformatter.cpp index a3d8481d58..c78f52f5b8 100644 --- a/src/libs/qmljs/qmljsreformatter.cpp +++ b/src/libs/qmljs/qmljsreformatter.cpp @@ -1102,7 +1102,8 @@ protected: out("case ", ast->caseToken); accept(ast->expression); out(ast->colonToken); - lnAcceptIndented(ast->statements); + if (ast->statements) + lnAcceptIndented(ast->statements); return false; } |