Skip to content

Commit d796058

Browse files
author
Kapil Borle
committed
Make EditableText.Lines return a read-only list
1 parent 7a421ca commit d796058

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Engine/EditableText.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class EditableText
2424
/// <summary>
2525
/// The lines in the Text.
2626
/// </summary>
27-
public string[] Lines { get { return lines.ToArray(); } }
27+
public IList<string> Lines => lines.ReadOnly();
2828

2929
/// <summary>
3030
/// The new line character in the Text.
@@ -118,8 +118,8 @@ public bool IsValidRange(Range range)
118118
throw new ArgumentNullException(nameof(range));
119119
}
120120

121-
return range.Start.Line <= Lines.Length
122-
&& range.End.Line <= Lines.Length
121+
return range.Start.Line <= Lines.Count
122+
&& range.End.Line <= Lines.Count
123123
&& range.Start.Column <= Lines[range.Start.Line - 1].Length
124124
&& range.End.Column <= Lines[range.End.Line - 1].Length + 1;
125125
}

0 commit comments

Comments
 (0)