public Line(string text, LineModification changed, Document document) { if (document == null) throw new ArgumentNullException("document"); this.text = text; this.Dirty = changed; this.document = document; if (changed == LineModification.Unsaved) document.Dirty = true; }
public void PaintLine(Line line, Gutter.Gutter gutter, int firstColumn, Document doc) { var x = 0; var offset = gutter.Width - (firstColumn * geometry.CharWidth); var spans = doc.ApplySelectionSpan(line.Spans, line); foreach (var span in SplitSpansForRendering(spans)) { if (span.renderCache == null) span.renderCache = new RenderCache(span, geometry, line, x); if (offset + span.renderCache.Width >= 0) PaintSpan(span, offset); offset += span.renderCache.Width; x += span.renderCache.Text.Length; if (offset > g.ClipBounds.Right) break; } }
internal Caret(Document document, int line, int column) : this(document) { this.line = line; this.column = column; }
internal Caret(Document document) { this.document = document; }
public static Caret AtVirtualPosition(Document d, Point location) { Caret c = Caret.AtStartOfLine(d, location.X); c.column = c.GetRealColumn(location.Y); return c; }
public static Caret AtStartOfLine(Document d, int line) { return new Caret(d, line, 0); }
public static Caret AtStartOfDocument(Document document) { return new Caret(document, 0, 0); }
public static Caret AtEndOfLine(Document d, int line) { return new Caret(d, line, d.Lines[line].Text.Length); }
public static Caret AtEndOfDocument(Document Document) { return AtEndOfLine(Document, Document.Lines.Count - 1); }