Ejemplo n.º 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));
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 3
0
 public override void FormatLines(ITextView textView, EditorUtils.SnapshotLineRange range)
 {
     throw new NotImplementedException();
 }