Example #1
0
        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;
        }
Example #2
0
        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;
            }
        }
Example #3
0
 internal Caret(Document document, int line, int column)
     : this(document)
 {
     this.line = line;
     this.column = column;
 }
Example #4
0
 internal Caret(Document document)
 {
     this.document = document;
 }
Example #5
0
 public static Caret AtVirtualPosition(Document d, Point location)
 {
     Caret c = Caret.AtStartOfLine(d, location.X);
     c.column = c.GetRealColumn(location.Y);
     return c;
 }
Example #6
0
 public static Caret AtStartOfLine(Document d, int line)
 {
     return new Caret(d, line, 0);
 }
Example #7
0
 public static Caret AtStartOfDocument(Document document)
 {
     return new Caret(document, 0, 0);
 }
Example #8
0
 public static Caret AtEndOfLine(Document d, int line)
 {
     return new Caret(d, line, d.Lines[line].Text.Length);
 }
Example #9
0
 public static Caret AtEndOfDocument(Document Document)
 {
     return AtEndOfLine(Document, Document.Lines.Count - 1);
 }