FindRBuffer() 공개 정적인 메소드

Locates first R buffer in the projection buffer graph. Note that in REPL this may not be the active buffer. In REPL used FindInProjectedBuffers.
public static FindRBuffer ( ITextBuffer viewBuffer ) : ITextBuffer
viewBuffer ITextBuffer
리턴 ITextBuffer
예제 #1
0
        /// <summary>
        /// Maps given point from view buffer to R editor buffer
        /// </summary>
        public static SnapshotPoint?MapPointFromView(ITextView textView, SnapshotPoint point)
        {
            ITextBuffer   rBuffer;
            SnapshotPoint?documentPoint = null;

            IREditorDocument document = REditorDocument.FindInProjectedBuffers(textView.TextBuffer);

            if (document != null)
            {
                rBuffer = document.TextBuffer;
            }
            else
            {
                // Last resort, typically in unit tests when document is not available
                rBuffer = REditorDocument.FindRBuffer(textView.TextBuffer);
            }

            if (rBuffer != null)
            {
                if (textView.BufferGraph != null)
                {
                    documentPoint = textView.MapDownToBuffer(point, rBuffer);
                }
                else
                {
                    documentPoint = point;
                }
            }

            return(documentPoint);
        }