ClangFormat: Do not format code on auto save

Fixes: QTCREATORBUG-21990
Change-Id: I42f007bf9cb4a73c1561769d8e0eeeca266b0dba
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Ivan Donchevskii
2019-02-18 15:43:34 +01:00
parent 4d81349825
commit 660cd8da19

View File

@@ -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<TextEditor::TextDocumentLayout *>(document()->documentLayout());