mirror of
https://github.com/cuberite/TCLAP.git
synced 2025-09-10 20:57:06 -04:00
smartened printing even further
This commit is contained in:
parent
65fd6009a2
commit
b34918c2fe
@ -49,14 +49,24 @@ void spacePrint( ostream& os,
|
|||||||
s[stringLen+start] != '|' )
|
s[stringLen+start] != '|' )
|
||||||
stringLen--;
|
stringLen--;
|
||||||
|
|
||||||
|
// check for newlines
|
||||||
|
for ( int i = 0; i < stringLen; i++ )
|
||||||
|
if ( s[start+i] == '\n' )
|
||||||
|
stringLen = i+1;
|
||||||
|
|
||||||
// print the indent
|
// print the indent
|
||||||
for ( int i = 0; i < indentSpaces; i++ )
|
for ( int i = 0; i < indentSpaces; i++ )
|
||||||
os << " ";
|
os << " ";
|
||||||
|
|
||||||
// handle second line offsets
|
|
||||||
if ( start == 0 )
|
if ( start == 0 )
|
||||||
|
{
|
||||||
|
// handle second line offsets
|
||||||
indentSpaces += secondLineOffset;
|
indentSpaces += secondLineOffset;
|
||||||
|
|
||||||
|
// adjust allowed len
|
||||||
|
allowedLen -= secondLineOffset;
|
||||||
|
}
|
||||||
|
|
||||||
os << s.substr(start,stringLen) << endl;
|
os << s.substr(start,stringLen) << endl;
|
||||||
|
|
||||||
// so we don't start a line with a space
|
// so we don't start a line with a space
|
||||||
|
Loading…
x
Reference in New Issue
Block a user