forked from qt-creator/qt-creator
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
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -69,6 +69,7 @@ public:
|
||||
void updateLineStateChange(const QTextBlock &block);
|
||||
|
||||
int indentFor(const QTextBlock &block);
|
||||
int indentForNewLineAfter(const QTextBlock &block);
|
||||
|
||||
void setTabSize(int tabSize);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user