Fix rendering bug when splitting lines

The bug might occur if there are wide characters such as emojis
at the end of a line. The SplitLines method mixed cell width
and text length, which might give incorrect results. This commit
makes sure that comparison and calculation is done using cell width
where it's appropriate.
This commit is contained in:
Patrik Svensson
2020-10-24 01:45:41 +02:00
parent 041bd016a2
commit c9c0ad733f
11 changed files with 197 additions and 57 deletions

View File

@@ -57,7 +57,7 @@ namespace Spectre.Console.Internal
return;
}
var width = Segment.CellLength(context, segments);
var width = Segment.CellCount(context, segments);
if (width >= maxWidth)
{
return;