diff --git a/src/Spectre.Console/Extensions/StringExtensions.cs b/src/Spectre.Console/Extensions/StringExtensions.cs index d7db267..bfd1093 100644 --- a/src/Spectre.Console/Extensions/StringExtensions.cs +++ b/src/Spectre.Console/Extensions/StringExtensions.cs @@ -59,7 +59,12 @@ namespace Spectre.Console return result.ToString(); } - internal static int CellLength(this string text) + /// + /// Gets the cell width of the specified text. + /// + /// The text to get the cell width of. + /// The cell width of the text. + public static int GetCellWidth(this string text) { return Cell.GetCellLength(text); } diff --git a/src/Spectre.Console/Rendering/Segment.cs b/src/Spectre.Console/Rendering/Segment.cs index c998abc..832517b 100644 --- a/src/Spectre.Console/Rendering/Segment.cs +++ b/src/Spectre.Console/Rendering/Segment.cs @@ -423,7 +423,7 @@ namespace Spectre.Console.Rendering var builder = new StringBuilder(); foreach (var character in segment.Text) { - var accumulatedCellWidth = builder.ToString().CellLength(); + var accumulatedCellWidth = builder.ToString().GetCellWidth(); if (accumulatedCellWidth >= maxWidth) { break;