private void GoToPosition(ParseItem target) { try { var view = ExtensibilityHelper.GetCurentTextView(); var textBuffer = ExtensibilityHelper.GetCurentTextBuffer(); var span = new SnapshotSpan(textBuffer.CurrentSnapshot, target.Start, target.Length); var point = new SnapshotPoint(textBuffer.CurrentSnapshot, target.Start); view.ViewScroller.EnsureSpanVisible(span); view.Caret.MoveTo(point); //view.Selection.Select(span, false); } catch (Exception ex) { Logger.Log(ex, "Failed to navigate to line."); } }