diff options
author | Christian Kamm <christian.d.kamm@nokia.com> | 2010-09-08 16:18:58 +0200 |
---|---|---|
committer | Christian Kamm <christian.d.kamm@nokia.com> | 2010-09-08 16:22:23 +0200 |
commit | 5cd6ebfdfd94aa9745f2ca8e92c5ed24d6bc1afa (patch) | |
tree | 9fa31d3086c2097aca8c21fe308919616c247329 /src/plugins/cpptools/cppcodeformatter.cpp | |
parent | 2989ac1d69ac6fff8e27e881ea3d654425691c2a (diff) | |
download | qt-creator-5cd6ebfdfd94aa9745f2ca8e92c5ed24d6bc1afa.tar.gz |
C++: Only reindent on electric characters if indent wasn't user-changed.
This should make the indenter less strict and annoying for non-standard
indentation styles.
Reviewed-by: Roberto Raggi
Diffstat (limited to 'src/plugins/cpptools/cppcodeformatter.cpp')
-rw-r--r-- | src/plugins/cpptools/cppcodeformatter.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcodeformatter.cpp b/src/plugins/cpptools/cppcodeformatter.cpp index a162488088..89c9d85f5e 100644 --- a/src/plugins/cpptools/cppcodeformatter.cpp +++ b/src/plugins/cpptools/cppcodeformatter.cpp @@ -470,6 +470,12 @@ int CodeFormatter::indentFor(const QTextBlock &block) return m_indentDepth; } +int CodeFormatter::indentForNewLineAfter(const QTextBlock &block) +{ + restoreCurrentState(block); + return m_indentDepth; +} + void CodeFormatter::updateStateUntil(const QTextBlock &endBlock) { QStack<State> previousState = initialState(); |