Fixed issue when startline is EOF

This commit is contained in:
2019-01-31 15:13:26 +01:00
parent 49531b5595
commit 2e08669509

View File

@@ -15,6 +15,8 @@ namespace Upsilon.Text
public string GetSpan(int startLine, int startPosition, int endLine, int endPosition)
{
if (startPosition < 0) startPosition = 0;
if (startLine >= _text.Length)
return string.Empty;
if (startLine == endLine)
{
if (endPosition > _text[startLine].Length) endPosition = _text[startLine].Length;