Commit dec0b510 authored by Brad King's avatar Brad King 💬
Browse files

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

ENH: Improved formatting of plain-text help to add a blank line before the beginning of a preformatted section.
parent 0005e70c
...@@ -384,16 +384,20 @@ void cmDocumentation::PrintColumn(std::ostream& os, int width, ...@@ -384,16 +384,20 @@ void cmDocumentation::PrintColumn(std::ostream& os, int width,
} }
else else
{ {
// If this is the first line not beginning in a blank after // If we are switching from a line that has leading blanks
// a sequence of lines beginning in blanks, add an extra // to a line that does not, or vice versa, add an extra
// newline. // newline.
if(blanks) if(blanks)
{ {
if(!lastHadBlanks && !firstLine)
{
os << "\n";
}
lastHadBlanks = true; lastHadBlanks = true;
} }
else else
{ {
if(lastHadBlanks) if(lastHadBlanks && !firstLine)
{ {
os << "\n"; os << "\n";
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment