fix(core): Fixes wrap not slicing properly (#362)

- [X] Fixes wrap not slicing properly

Bumps release version
This commit is contained in:
Kamron Batman 2020-12-26 09:26:10 -08:00 committed by GitHub
parent 10a6e17640
commit 9c9591b098
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View file

@ -188,17 +188,15 @@ namespace Server
var newLineLength = lineLength + spaceIndex;
if (newLineLength == perLine || newLineLength == span.Length - 1)
if (newLineLength == perLine || newLineLength == span.Length)
{
// Could be the end of the string
var length = span[newLineLength] == ' ' ? newLineLength - 1 : newLineLength;
list.Add(span.Slice(0, length).ToString());
if (list.Count == maxLines)
list.Add(span.Slice(0, newLineLength).ToString());
if (list.Count == maxLines || newLineLength == span.Length)
{
break;
}
span = span.Slice(newLineLength);
span = span.Slice(newLineLength + 1);
lineLength = 0;
}
else if (newLineLength < perLine)
@ -235,7 +233,7 @@ namespace Server
index += perLine;
}
span = span.Slice(lineLength);
span = span.Slice(newLineLength - lineLength);
}
}