Fixed issue when startline is EOF

This commit is contained in:
Deukhoofd 2019-01-31 15:13:26 +01:00
parent 49531b5595
commit 2e08669509
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
1 changed files with 2 additions and 0 deletions

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;