From 5cd6ebfdfd94aa9745f2ca8e92c5ed24d6bc1afa Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Wed, 8 Sep 2010 16:18:58 +0200 Subject: 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 --- src/plugins/cpptools/cppcodeformatter.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/plugins/cpptools/cppcodeformatter.cpp') 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 previousState = initialState(); -- cgit v1.2.1