mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 00:42:51 +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:
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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user