From: Sylvestre Ledru Date: Thu, 7 Sep 2017 12:09:14 +0000 (+0000) Subject: Add an usage example of BreakBeforeBraces X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cb7a513bacbe0968dffc72c4883514d6a1b0639d;p=clang Add an usage example of BreakBeforeBraces Reviewers: djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D37531 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312717 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/ClangFormatStyleOptions.rst b/docs/ClangFormatStyleOptions.rst index 3a99ac1cb2..29f498528f 100644 --- a/docs/ClangFormatStyleOptions.rst +++ b/docs/ClangFormatStyleOptions.rst @@ -533,6 +533,15 @@ the configuration (without a prefix: ``Auto``). If ``BreakBeforeBraces`` is set to ``BS_Custom``, use this to specify how each individual brace case should be handled. Otherwise, this is ignored. + .. code-block:: yaml + + # Example of usage: + BreakBeforeBraces: Custom + BraceWrapping: + AfterEnum: true + AfterStruct: false + SplitEmptyFunction: false + Nested configuration flags: diff --git a/include/clang/Format/Format.h b/include/clang/Format/Format.h index 19ebad8f19..48ed37c3b6 100644 --- a/include/clang/Format/Format.h +++ b/include/clang/Format/Format.h @@ -746,6 +746,14 @@ struct FormatStyle { /// /// If ``BreakBeforeBraces`` is set to ``BS_Custom``, use this to specify how /// each individual brace case should be handled. Otherwise, this is ignored. + /// \code{.yaml} + /// # Example of usage: + /// BreakBeforeBraces: Custom + /// BraceWrapping: + /// AfterEnum: true + /// AfterStruct: false + /// SplitEmptyFunction: false + /// \endcode BraceWrappingFlags BraceWrapping; /// \brief If ``true``, ternary operators will be placed after line breaks.