summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcodeformatter.cpp
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2010-09-15 11:12:32 +0200
committerChristian Kamm <christian.d.kamm@nokia.com>2010-09-15 11:16:25 +0200
commitd68e9e1a4d6b7b72a9ab0cfcfbbd3901e32594c0 (patch)
treea05529027596bc2171523b917aeea30c5ee68cbb /src/plugins/cpptools/cppcodeformatter.cpp
parente5cbb56fe7d03af0ae715204bc65b0103ebc8be1 (diff)
downloadqt-creator-d68e9e1a4d6b7b72a9ab0cfcfbbd3901e32594c0.tar.gz
C++ indenter: Fix curly brace placement for ANSI style.
There was a bug in 5cd6ebfdfd94aa9745f2ca8e92c5ed24d6bc1afa which meant no reindent of the current line was triggered for the opening curly brace on a new line. Task-number: QTCREATORBUG-2331
Diffstat (limited to 'src/plugins/cpptools/cppcodeformatter.cpp')
-rw-r--r--src/plugins/cpptools/cppcodeformatter.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcodeformatter.cpp b/src/plugins/cpptools/cppcodeformatter.cpp
index c88e422135..b242f6c490 100644
--- a/src/plugins/cpptools/cppcodeformatter.cpp
+++ b/src/plugins/cpptools/cppcodeformatter.cpp
@@ -477,6 +477,11 @@ void CodeFormatter::indentForNewLineAfter(const QTextBlock &block, int *indent,
restoreCurrentState(block);
*indent = m_indentDepth;
*padding = m_paddingDepth;
+
+ int lexerState = loadLexerState(block);
+ m_tokens.clear();
+ m_currentLine.clear();
+ adjustIndent(m_tokens, lexerState, indent, padding);
}
void CodeFormatter::updateStateUntil(const QTextBlock &endBlock)