wrap.strings: empty strings should wrap as the indent.
							parent
							
								
									9aeb3b9579
								
							
						
					
					
						commit
						109b35572f
					
				| 
						 | 
				
			
			@ -47,3 +47,5 @@ word wrap."""
 | 
			
		|||
 | 
			
		||||
[ "" ] [ "" 10 wrap-string ] unit-test
 | 
			
		||||
[ "Hello" ] [ "\nHello\n" 10 wrap-string ] unit-test
 | 
			
		||||
 | 
			
		||||
{ " > > > " } [ "" 70 " > > > " wrap-indented-string ] unit-test
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -34,4 +34,4 @@ PRIVATE>
 | 
			
		|||
 | 
			
		||||
: wrap-indented-string ( string width indent -- newstring )
 | 
			
		||||
    make-indent [ length - wrap-lines ] keep
 | 
			
		||||
    '[ _ prepend ] map! join-lines ;
 | 
			
		||||
    over empty? [ nip ] [ '[ _ prepend ] map! join-lines ] if ;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue