From 793ef6a694c16b78f4810eb6c82cad4233e4b1c6 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Tue, 6 Jul 2010 09:44:04 +0200 Subject: C++ indenter: Fix 'else' indentation in GNU style. --- src/plugins/cpptools/cppcodeformatter.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/plugins/cpptools/cppcodeformatter.cpp') 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: -- cgit v1.2.1