From 27a61d482f4e8e04c503783229b5ea5eb2143805 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 8 Jun 2023 12:42:21 +0200 Subject: ClangFormat: Fix that formatting was wrongly disabled After starting Qt Creator with the Beautifier plugin, turning its automatic format on save option on, and restarting Qt Creator _without_ the Beautifier plugin, clang format was no longer formatting on save. The clang format based formatting is supposed to be disabled if - the Beautifier plugin is enabled, and - its automatic format on save option is enabled. Fix the check for the first condition, the plugin can be present but disabled, explicitly check if it is enabled. Change-Id: I5c9c270dd47ceec665aebca5b613f0c4a5357d72 Reviewed-by: Artem Sokolovskii Reviewed-by: Reviewed-by: Christian Kandeler --- src/plugins/clangformat/clangformatindenter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/clangformat/clangformatindenter.cpp b/src/plugins/clangformat/clangformatindenter.cpp index 94e0fafd8e..fa3a9d5d63 100644 --- a/src/plugins/clangformat/clangformatindenter.cpp +++ b/src/plugins/clangformat/clangformatindenter.cpp @@ -32,7 +32,7 @@ static bool isBeautifierPluginActivated() return std::find_if(specs.begin(), specs.end(), [](ExtensionSystem::PluginSpec *spec) { - return spec->name() == "Beautifier"; + return spec->name() == "Beautifier" && spec->isEffectivelyEnabled(); }) != specs.end(); } -- cgit v1.2.3