private void SelectResult(TextRange range) { TextLocation p1 = _editor.Document.OffsetToPosition(range.Offset); TextLocation p2 = _editor.Document.OffsetToPosition(range.Offset + range.Length); _editor.ActiveTextAreaControl.SelectionManager.SetSelection(p1, p2); _editor.ActiveTextAreaControl.ScrollTo(p1.Line, p1.Column); // Also move the caret to the end of the selection, because when the user // presses F3, the caret is where we start searching next time. _editor.ActiveTextAreaControl.Caret.Position = _editor.Document.OffsetToPosition(range.Offset + range.Length); }