Insert the character at the current cursor position.

        This method also adds another undo-object to the undo-stack.
169678
def keyPressEvent(self, keyEvent):
        
        undoObj = UndoSelfInsert(self, keyEvent.text())
        self.qteUndoStack.push(undoObj)
887098
def _cursor_forward(self, value):
        
        if value <= 0:
            value = 1
        self._cursor.movePosition(self._cursor.Right, self._cursor.MoveAnchor, value)
        self._text_edit.setTextCursor(self._cursor)
        self._last_cursor_pos = self._cursor.position()
323418
public static void insert (@Nonnull final CharSequence aSeq, final int nIndex, final int nCodepoint)
  {
    if (!(aSeq instanceof StringBuilder))
    {
      insert (new StringBuilder (aSeq), nIndex, nCodepoint);
    }
    else
    {
      int nI = nIndex;
      if (nI > 0 && nI < aSeq.length ())
      {
        final char ch = aSeq.charAt (nI);
        final boolean low = Character.isLowSurrogate (ch);
        if (low && Character.isHighSurrogate (aSeq.charAt (nI - 1)))
        {
          nI--;
        }
      }
      ((StringBuilder) aSeq).insert (nI, Character.toChars (nCodepoint));
    }
  }
823942
def insert_comment(event):
    
    buff = event.current_buffer

    # Transform all lines.
    if event.arg != 1:
        def change(line):
            return line[1:] if line.startswith('#') else line
    else:
        def change(line):
            return '#' + line

    buff.document = Document(
        text='\n'.join(map(change, buff.text.splitlines())),
        cursor_position=0)

    # Accept input.
    buff.accept_action.validate_and_handle(event.cli, buff)
90795
def insert(self, iter, text, length=-1):
        

        Gtk.TextBuffer.insert(self, iter, text, length)
459695
def reverseCommit(self):
        
        # Ensure that the cursor position is valid.
        if not self.qteWidget.isSelectionPositionValid(self.selectionPos):
            msg = ('Cannot undo "insert" operation because the selection'
                   'position is invalid. The document is possibly in '
                   'an inconsistent state. Please save and re-open.')
            qteMain.qteLogger.critical(msg)
            return

        # Select and delete the inserted text.
        self.qteWidget.setSelection(*self.selectionPos)
        self.baseClass.removeSelectedText()
        line, col = self.selectionPos[0:2]
        self.qteWidget.setCursorPosition(line, col)
920565
def quoted_insert(self, e): # (C-q or C-v)
        '''
        e = self.console.getkeypress()
        self.insert_text(e.char)
1314075
def put_char(self, char, r, g, b):
		
		r, g, b = r & 0xff, g & 0xff, b & 0xff
		if(char == 0):
			char = " "

		if(char == "\r"):
			self.cursor[1] = 0
			return
		if(char == "\t"):
			for i in range(8):
				self.put_char(" ", r, g, b)
			return
		
		if(self.max_chars_per_col > self.cursor[0]):
			if(char == "\n"):
				self.cursor[1] = 0
				self.cursor[0] += 1
				return

			if(self.max_chars_per_line > self.cursor[1]):
				self.char_buffer[self.cursor[0]][self.cursor[1]] = (char, r, g, b)
				self.cursor[1] += 1
			else:
				self.cursor[0] += 1
				self.cursor[1] = 0
				self.char_buffer[self.cursor[0]][self.cursor[1]] = (char, r, g, b)
				self.cursor[1] += 1
			self.draw_char_screen()
		else:
			self.char_buffer.append([(" ", 0xff, 0xff, 0xff) for i in range(self.max_chars_per_line)])
			self.cursor[0] -= 1
			self.put_char(char, r, g, b)
479937
def insert(self, i, tag, affix, cmd="hassuf", tagged=None):
        
        if affix.startswith("-") and affix.endswith("-"):
            affix, cmd = affix[+1:-1], "char"
        if affix.startswith("-"):
            affix, cmd = affix[+1:-0], "hassuf"
        if affix.endswith("-"):
            affix, cmd = affix[+0:-1], "haspref"
        if tagged:
            r = [tagged, affix, "f"+cmd.lstrip("f"), tag, "x"]
        else:
            r = [affix, cmd.lstrip("f"), tag, "x"]
        lazylist.insert(self, i, r)
807849
def _set_input_buffer(self, text):
        """"""
        if self.current_prompt_pos is not None:
            self.replace_text(self.current_prompt_pos, 'eol', text)
        else:
            self.insert(text)
        self.set_cursor_position('eof')
326271
def placeCursor(self, line, col):
        
        num_lines, num_col = self.qteWidget.getNumLinesAndColumns()

        # Place the cursor at the specified position if possible.
        if line >= num_lines:
            line, col = num_lines, num_col
        else:
            text = self.qteWidget.text(line)
            if col >= len(text):
                col = len(text) - 1

        self.qteWidget.setCursorPosition(line, col)
308906
def reverseCommit(self):
        

        # Loop over all lines in the rectangle to remove the
        # previously yanked strings.
        col = self.cursorPos[1]
        for ii, text in enumerate(self.insertedText):
            line = ii + self.cursorPos[0]

            # Select as many characters as the string is long and remove
            # them.
            self.qteWidget.setSelection(line, col, line, col + len(text))
            self.baseClass.removeSelectedText()

        # Place the cursor at the original position.
        self.qteWidget.setCursorPosition(*self.cursorPos)
56894
def reverseCommit(self):
        

        # Do nothing if no selection was available upon construction.
        if self.selectionPos is None:
            return

        # Insert the text at the specified position.
        line, col = self.selectionPos[:2]
        self.baseClass.insertAt(self.removedText, line, col)

        # Add the styling information.
        self.qteWidget.SCISetStylingEx(line, col, self.style)

        # Place the cursor at the end of the selection.
        line, col = self.selectionPos[2:]
        self.qteWidget.setCursorPosition(line, col)
885387
private final void insert(Object x) {
        buffer[putIndex] = x;

        if (++putIndex >= buffer.length) {
            putIndex = 0;
        }
    }
720615
def insert_break
      return -1 unless @editable
      # insert a blank row and append rest of this line to cursor
      $log.debug "ENTER PRESSED at  #{@curpos}, on row #{@current_index}"
      @delete_buffer = (delete_eol || "")
      @list[@current_index] << "\r"
      $log.debug "DELETE BUFFER #{@delete_buffer}" 
      @list.insert @current_index+1, @delete_buffer 
      @curpos = 0
      down
      col = @orig_col + @col_offset
      setrowcol @row+1, col
      # FIXME maybe this should be insert line since line inserted, not just data, undo will delete it
      fire_handler :CHANGE, InputDataEvent.new(@curpos,@curpos+@delete_buffer.length, self, :INSERT_LINE, @current_index, @delete_buffer)     #  2008-12-24 18:34 
    end
567889
public static void dumpCursor(Cursor cursor, StringBuilder sb) {
        sb.append(">>>>> Dumping cursor " + cursor + "\n");
        if (cursor != null) {
            int startPos = cursor.getPosition();

            cursor.moveToPosition(-1);
            while (cursor.moveToNext()) {
                dumpCurrentRow(cursor, sb);
            }
            cursor.moveToPosition(startPos);
        }
        sb.append("<<<<<\n");
    }
962147
def insertFromMimeData(self, data):
        
        undoObj = UndoPaste(self, data, self.pasteCnt)
        self.pasteCnt += 1
        self.qteUndoStack.push(undoObj)