From 0a0380ae0a88ddd6492da13c53dd964a57ceb654 Mon Sep 17 00:00:00 2001 From: Khalid Abuhakmeh Date: Thu, 8 Oct 2020 15:43:48 -0400 Subject: [PATCH] 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 --- src/Spectre.Console/Rendering/Segment.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Spectre.Console/Rendering/Segment.cs b/src/Spectre.Console/Rendering/Segment.cs index 58667ec..84c166a 100644 --- a/src/Spectre.Console/Rendering/Segment.cs +++ b/src/Spectre.Console/Rendering/Segment.cs @@ -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(); } result.Add(new Segment(segment.Text.Substring(index, take), segment.Style));