summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcodeformatter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/cpptools/cppcodeformatter.cpp')
-rw-r--r--src/plugins/cpptools/cppcodeformatter.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcodeformatter.cpp b/src/plugins/cpptools/cppcodeformatter.cpp
index 4eb3a3ac84..97db194e70 100644
--- a/src/plugins/cpptools/cppcodeformatter.cpp
+++ b/src/plugins/cpptools/cppcodeformatter.cpp
@@ -1006,6 +1006,8 @@ void QtStyleCodeFormatter::onEnter(int newState, int *indentDepth, int *savedInd
while (isBracelessState(state(outermostBraceless).type))
++outermostBraceless;
*indentDepth = state(outermostBraceless - 1).savedIndentDepth;
+ // this is where the else should go, if one appears - aligned to if_statement
+ *savedIndentDepth = state().savedIndentDepth;
} break;
case for_statement_paren_open: