예제 #1
0
        /// <summary>
        /// Return the overaching SnapshotLineRange for the visible lines in the ITextView
        /// </summary>
        public static SnapshotLineRange?GetVisibleSnapshotLineRange(this ITextView textView)
        {
            if (textView.InLayout)
            {
                return(null);
            }
            var snapshot  = textView.TextSnapshot;
            var lines     = textView.TextViewLines;
            var startLine = lines.FirstVisibleLine.Start.GetContainingLine().LineNumber;
            var lastLine  = lines.LastVisibleLine.End.GetContainingLine().LineNumber;

            return(SnapshotLineRange.CreateForLineNumberRange(textView.TextSnapshot, startLine, lastLine));
        }
예제 #2
0
 public static SnapshotLineRange GetLineRange(this ITextSnapshot snapshot, int startLine, int endLine = -1)
 {
     endLine = endLine >= 0 ? endLine : startLine;
     return(SnapshotLineRange.CreateForLineNumberRange(snapshot, startLine, endLine).Value);
 }
예제 #3
0
 public override void FormatLines(ITextView textView, EditorUtils.SnapshotLineRange range)
 {
     throw new NotImplementedException();
 }