diff --git a/src/plugins/cppeditor/cppeditordocument.cpp b/src/plugins/cppeditor/cppeditordocument.cpp index d058adac9ee..c6f2b9edc88 100644 --- a/src/plugins/cppeditor/cppeditordocument.cpp +++ b/src/plugins/cppeditor/cppeditordocument.cpp @@ -461,7 +461,7 @@ static int formatRange(QTextDocument *doc, bool CppEditorDocument::save(QString *errorString, const QString &fileName, bool autoSave) { - if (indenter()->formatOnSave()) { + if (indenter()->formatOnSave() && !autoSave) { QTextCursor cursor(document()); cursor.joinPreviousEditBlock(); auto *layout = qobject_cast(document()->documentLayout());