Skip to content

Commit

Permalink
Make EditableText.Lines return a read-only list
Browse files Browse the repository at this point in the history
  • Loading branch information
Kapil Borle committed Jun 16, 2017
1 parent 7a421ca commit d796058
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Engine/EditableText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class EditableText
/// <summary>
/// The lines in the Text.
/// </summary>
public string[] Lines { get { return lines.ToArray(); } }
public IList<string> Lines => lines.ReadOnly();

/// <summary>
/// The new line character in the Text.
Expand Down Expand Up @@ -118,8 +118,8 @@ public bool IsValidRange(Range range)
throw new ArgumentNullException(nameof(range));
}

return range.Start.Line <= Lines.Length
&& range.End.Line <= Lines.Length
return range.Start.Line <= Lines.Count
&& range.End.Line <= Lines.Count
&& range.Start.Column <= Lines[range.Start.Line - 1].Length
&& range.End.Column <= Lines[range.End.Line - 1].Length + 1;
}
Expand Down

0 comments on commit d796058

Please sign in to comment.