From 85dcfafe5ba27b4bfb20d9cf19dbbd340e081838 Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Fri, 15 Mar 2019 13:19:15 +0100 Subject: [PATCH] ClangFormat: Split formatting on save into a separate editor action Do not combine formatting on save with other action happening before it. Fixes: QTCREATORBUG-22145 Change-Id: I435115400b9bef1377fac992b4952d3701fca3ac Reviewed-by: Eike Ziller --- 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 8a584915103..6da4ac43fc6 100644 --- a/src/plugins/cppeditor/cppeditordocument.cpp +++ b/src/plugins/cppeditor/cppeditordocument.cpp @@ -475,7 +475,7 @@ bool CppEditorDocument::save(QString *errorString, const QString &fileName, bool if (!editedRanges.empty()) { QTextCursor cursor(document()); - cursor.joinPreviousEditBlock(); + cursor.beginEditBlock(); indenter()->format(editedRanges); cursor.endEditBlock(); }