Exemplo n.º 1
0
        private void InsertChar(char c)
        {
            cur.AddUndo(new Undo(UndoAction.ReplaceSelection, c.ToString(), getSelection(), col, row, selCol, selRow));
            if (hasSelection)
            {
                DeleteSelection(false);
            }
            string l = lines[row];

            if (col > l.Length)
            {
                col = l.Length;
            }
            if (_overwrite && col < l.Length)
            {
                lines[row] = l.Substring(0, col) + c.ToString() + l.Substring(col + 1);
            }
            else
            {
                lines[row] = l.Substring(0, col) + c.ToString() + l.Substring(col);
            }
            col++;
            PositionShowCursor(true, false);
            Changed();
        }