Ejemplo n.º 1
0
 internal static void BreakLines(int iLine, int pos, QText tb)
 {
     Line newLine = new Line(tb.GenerateUniqueLineId());
     for (int i = pos; i < tb[iLine].Count; i++)
         newLine.Add(tb[iLine][i]);
     tb[iLine].RemoveRange(pos, tb[iLine].Count - pos);
     tb.InsertLine(iLine + 1, newLine);
 }
Ejemplo n.º 2
0
        internal static void InsertLine(QText tb)
        {
            if (tb.LinesCount == 0) tb.InsertLine(tb.Selection.Start.iLine + 1, new Line(tb.GenerateUniqueLineId()));
            else BreakLines(tb.Selection.Start.iLine, tb.Selection.Start.iChar, tb);

            tb.Selection.Start = new Place(0, tb.Selection.Start.iLine + 1);
            tb.needRecalc = true;
        }