[clang] [clang-format][NFC] Improve KeepFormFeed option decription (PR #176654)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 19 06:51:01 PST 2026


================
@@ -3517,10 +3517,17 @@ struct FormatStyle {
   /// \version 3.7
   // bool KeepEmptyLinesAtTheStartOfBlocks;
 
-  /// Keep the form feed character if it's immediately preceded and followed by
-  /// a newline. Multiple form feeds and newlines within a whitespace range are
-  /// replaced with a single newline and form feed followed by the remaining
-  /// newlines.
+  /// Keep the form feed character (``\f``) if it's immediately preceded and
+  /// followed by a newline. Multiple form feeds and newlines within a
+  /// whitespace range are replaced with a single newline and form feed
+  /// followed by the remaining newlines.
+  /// \code
+  ///   false:          true:
+  ///
+  ///   "int i;\n"      "int i;\n"
+  ///   "\n"            "\f\n"
+  ///   "void f();"     "void f();"
+  /// \endcode
----------------
vbvictor wrote:

Corrected with link to GNU standart, but still left example of form-feed character. It gives a clear example of what it is, and if a user had never seen it/had any issues - they can skip this option.

https://github.com/llvm/llvm-project/pull/176654


More information about the cfe-commits mailing list