/// <summary>
 /// Sets the editor selection to the given range.
 /// </summary>
 /// <param name="range">Target <see cref="CharacterRange"/> that will be the new editor selection.</param>
 public void SetEditorSelection(CharacterRange range)
 {
     Editor.SetSel(range.cpMin, range.cpMax);
 }
 /// <summary>
 /// Checks if the given range has wrapped relative to the current selection in the editor.
 /// </summary>
 /// <param name="range"><see cref="CharacterRange"/> to check.</param>
 /// <param name="up">Direction to check.</param>
 /// <returns>True if the given range is below the current selection when the direction is up, or above the current selection when the direction is down.</returns>
 public bool HasWrapped(CharacterRange range, bool up)
 {
     return(up ? (range.cpMin > Editor.CurrentPosition) : (range.cpMin < Editor.AnchorPosition));
 }