mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-10-31 09:09:25 +08:00 
			
		
		
		
	Don't throw when console is small
this just returns an empty collection when take is 0. It leads to some strange output, but it doesn't blow up. #93
This commit is contained in:
		 Khalid Abuhakmeh
					Khalid Abuhakmeh
				
			
				
					committed by
					
						 Patrik Svensson
						Patrik Svensson
					
				
			
			
				
	
			
			
			 Patrik Svensson
						Patrik Svensson
					
				
			
						parent
						
							ae92c606bb
						
					
				
				
					commit
					0a0380ae0a
				
			| @@ -306,7 +306,7 @@ namespace Spectre.Console.Rendering | ||||
|                     { | ||||
|                         // This shouldn't really occur, but I don't like | ||||
|                         // never ending loops if it does... | ||||
|                         throw new InvalidOperationException("Text folding failed since 'take' was zero."); | ||||
|                         return new List<Segment>(); | ||||
|                     } | ||||
|  | ||||
|                     result.Add(new Segment(segment.Text.Substring(index, take), segment.Style)); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user