Fixed issue when startline is EOF
This commit is contained in:
parent
49531b5595
commit
2e08669509
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue