/// <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)); }
public static SnapshotLineRange GetLineRange(this ITextSnapshot snapshot, int startLine, int endLine = -1) { endLine = endLine >= 0 ? endLine : startLine; return(SnapshotLineRange.CreateForLineNumberRange(snapshot, startLine, endLine).Value); }
public override void FormatLines(ITextView textView, EditorUtils.SnapshotLineRange range) { throw new NotImplementedException(); }