From cf816448ce48f88ecc76b8fe19cc9408b6f86723 Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Tue, 13 Nov 2018 08:01:13 +0100 Subject: [PATCH] ClangFormat: Set BreakBeforeBraces to Custom by default If it's not set to custom some user settings are continuously overridden which is not always expected. Previously the default style caused some parameters to be reset. Change-Id: Ie0fedf6b9984116a86b7c588aed8c6b6cb35133e Reviewed-by: Marco Bubke Reviewed-by: Nikolai Kosjar --- src/plugins/clangformat/clangformatutils.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index 6bb153b3b39..9302e15361b 100644 --- a/src/plugins/clangformat/clangformatutils.cpp +++ b/src/plugins/clangformat/clangformatutils.cpp @@ -116,6 +116,8 @@ Utils::FileName currentStyleConfigPath() static clang::format::FormatStyle constructStyle(bool isGlobal) { FormatStyle style = getLLVMStyle(); + style.BreakBeforeBraces = FormatStyle::BS_Custom; + const CppCodeStyleSettings codeStyleSettings = isGlobal ? CppCodeStyleSettings::currentGlobalCodeStyle() : CppCodeStyleSettings::currentProjectCodeStyle()