From f561d71e4e6c1d0499e366d07e305b050b76d51d Mon Sep 17 00:00:00 2001 From: Matthew Constable Date: Thu, 31 Dec 2020 10:01:15 +0000 Subject: [PATCH] Remove unused Segment.TruncateWithEllipsis method --- src/Spectre.Console/Rendering/Segment.cs | 36 ------------------------ 1 file changed, 36 deletions(-) diff --git a/src/Spectre.Console/Rendering/Segment.cs b/src/Spectre.Console/Rendering/Segment.cs index c80cb0f6..59994eb2 100644 --- a/src/Spectre.Console/Rendering/Segment.cs +++ b/src/Spectre.Console/Rendering/Segment.cs @@ -550,42 +550,6 @@ namespace Spectre.Console.Rendering return result; } - internal static Segment TruncateWithEllipsis(string text, Style style, RenderContext context, int maxWidth) - { - if (text is null) - { - throw new ArgumentNullException(nameof(text)); - } - - if (style is null) - { - throw new ArgumentNullException(nameof(style)); - } - - if (context is null) - { - throw new ArgumentNullException(nameof(context)); - } - - var overflow = SplitOverflow(new Segment(text, style), Overflow.Ellipsis, context, maxWidth); - if (overflow.Count == 0) - { - if (maxWidth > 0) - { - return new Segment(text, style); - } - - // We got space for an ellipsis - return new Segment("…", style); - } - - return SplitOverflow( - new Segment(text, style), - Overflow.Ellipsis, - context, - maxWidth)[0]; - } - internal static List TruncateWithEllipsis(IEnumerable segments, RenderContext context, int maxWidth) { if (segments is null)