From 7ef1ac483abd786cd442760810fc99024042b84b Mon Sep 17 00:00:00 2001 From: Patrik Svensson Date: Sat, 17 Oct 2020 12:26:30 +0200 Subject: [PATCH] Fix overflow splitting bug Closes #93 --- examples/Tables/Program.cs | 1 + src/Spectre.Console/Rendering/Segment.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/Tables/Program.cs b/examples/Tables/Program.cs index a16f0a9..495b21a 100644 --- a/examples/Tables/Program.cs +++ b/examples/Tables/Program.cs @@ -1,3 +1,4 @@ +using System.Diagnostics; using Spectre.Console; namespace TableExample diff --git a/src/Spectre.Console/Rendering/Segment.cs b/src/Spectre.Console/Rendering/Segment.cs index 84c166a..aa74d5e 100644 --- a/src/Spectre.Console/Rendering/Segment.cs +++ b/src/Spectre.Console/Rendering/Segment.cs @@ -302,7 +302,7 @@ namespace Spectre.Console.Rendering // How many characters should we take? var take = Math.Min(width, totalLength - index); - if (take == 0) + if (take <= 0) { // This shouldn't really occur, but I don't like // never ending loops if it does...