diff --git a/docs/ClangFormatStyleOptions.rst b/docs/ClangFormatStyleOptions.rst index 3a99ac1cb244fa23eeb9b06cc00e7158d79f9833..29f498528f6ef82e3319e3775d3ef11d8c872c0f 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 19ebad8f1967a6e74b0253fefc81dd3dfa09a8f6..48ed37c3b6fa0fe9406ea8b42c6e9b2c9a507812 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.