mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
Fixed line wrap bug
Added line wrap tests and modified wrap algo to wrap within words using a -
This commit is contained in:
@@ -25,8 +25,14 @@ namespace Catch {
|
||||
for( std::size_t pos = 0; pos < paragraph.size(); ++pos ) {
|
||||
if( pos == width ) {
|
||||
addIndent( os, indent );
|
||||
os << paragraph.substr( 0, wrapPoint ) << "\n";
|
||||
return recursivelyWrapLine( os, paragraph.substr( wrapPoint+1 ), columns, indent+tab );
|
||||
if( paragraph[wrapPoint] == ' ' ) {
|
||||
os << paragraph.substr( 0, wrapPoint ) << "\n";
|
||||
while( paragraph[++wrapPoint] == ' ' );
|
||||
}
|
||||
else {
|
||||
os << paragraph.substr( 0, --wrapPoint ) << "-\n";
|
||||
}
|
||||
return recursivelyWrapLine( os, paragraph.substr( wrapPoint ), columns, indent+tab );
|
||||
}
|
||||
if( paragraph[pos] == '\t' ) {
|
||||
tab = pos;
|
||||
|
Reference in New Issue
Block a user