From 660cd8da1968c51fd854e1763ce76ef833aabc9c Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Mon, 18 Feb 2019 15:43:34 +0100 Subject: [PATCH] ClangFormat: Do not format code on auto save Fixes: QTCREATORBUG-21990 Change-Id: I42f007bf9cb4a73c1561769d8e0eeeca266b0dba Reviewed-by: Marco Bubke --- src/plugins/cppeditor/cppeditordocument.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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());