Fixed issue when startline is EOF
This commit is contained in:
@@ -15,6 +15,8 @@ namespace Upsilon.Text
|
|||||||
public string GetSpan(int startLine, int startPosition, int endLine, int endPosition)
|
public string GetSpan(int startLine, int startPosition, int endLine, int endPosition)
|
||||||
{
|
{
|
||||||
if (startPosition < 0) startPosition = 0;
|
if (startPosition < 0) startPosition = 0;
|
||||||
|
if (startLine >= _text.Length)
|
||||||
|
return string.Empty;
|
||||||
if (startLine == endLine)
|
if (startLine == endLine)
|
||||||
{
|
{
|
||||||
if (endPosition > _text[startLine].Length) endPosition = _text[startLine].Length;
|
if (endPosition > _text[startLine].Length) endPosition = _text[startLine].Length;
|
||||||
|
|||||||
Reference in New Issue
Block a user