浏览代码

ENH: Improved formatting of plain-text help to add a blank line before the beginning of a preformatted section.

Brad King 23 年之前
父节点
当前提交
dec0b51066
共有 1 个文件被更改,包括 7 次插入3 次删除
  1. 7 3
      Source/cmDocumentation.cxx

+ 7 - 3
Source/cmDocumentation.cxx

@@ -384,16 +384,20 @@ void cmDocumentation::PrintColumn(std::ostream& os, int width,
           }
         else
           {
-          // If this is the first line not beginning in a blank after
-          // a sequence of lines beginning in blanks, add an extra
+          // If we are switching from a line that has leading blanks
+          // to a line that does not, or vice versa, add an extra
           // newline.
           if(blanks)
             {
+            if(!lastHadBlanks && !firstLine)
+              {
+              os << "\n";
+              }
             lastHadBlanks = true;
             }
           else
             {
-            if(lastHadBlanks)
+            if(lastHadBlanks && !firstLine)
               {
               os << "\n";
               }