Microsoft.R.Editor.Document.REditorDocument.MapCaretPositionFromView C# (CSharp) Method

MapCaretPositionFromView() public static method

Maps caret position in text view to position in the projected R editor text buffer. R text buffer can be projected into view in REPL window case or in case when R is embedded in another language file such as in SQL file.
public static MapCaretPositionFromView ( ITextView textView ) : SnapshotPoint?
textView ITextView
return SnapshotPoint?
        public static SnapshotPoint? MapCaretPositionFromView(ITextView textView) {
            try {
                SnapshotPoint caretPosition = textView.Caret.Position.BufferPosition;
                return MapPointFromView(textView, caretPosition);
            } catch(ArgumentException) { }
            return null;
        }