Re-insert the previously deleted line.
542418
def reverseCommit(self):
        

        if self.markerPos is None:
            return

        # Remove the specified string from the same position in every line
        # in between the mark and the cursor (inclusive).
        col = min((self.markerPos[1], self.cursorPos[1]))
        rng = range(self.markerPos[0], self.cursorPos[0] + 1)
        for idx, line in enumerate(rng):
            text = self.removedText[idx]
            if text != '':
                self.baseClass.insertAt(text, line, col)

        self.qteWidget.setCursorPosition(*self.cursorPos)
1192385
def auto_newline(buffer):
    
    """
    insert_text = buffer.insert_text

    if buffer.document.current_line_after_cursor:
        # When we are in the middle of a line. Always insert a newline.
        insert_text('\n')
    else:
        # Go to new line, but also add indentation.
        current_line = buffer.document.current_line_before_cursor.rstrip()
        insert_text('\n')

        # Unident if the last line ends with 'pass', remove four spaces.
        unindent = current_line.rstrip().endswith(' pass')

        # Copy whitespace from current line
        current_line2 = current_line[4:] if unindent else current_line

        for c in current_line2:
            if c.isspace():
                insert_text(c)
            else:
                break

        # If the last line ends with a colon, add four extra spaces.
        if current_line[-1:] == ':':
            for x in range(4):
                insert_text(' ')
427851
public void addRecoverCommand() {
        StringBuilder buf = new StringBuilder();
        buf.append("(recover)");
        fifo.add(fifo.size(), buf.toString());
    }
431257
def insertPreviousCommand(self):
        
        self._currentHistoryIndex -= 1
        if 0 <= self._currentHistoryIndex < len(self._history):
            cmd = self._history[self._currentHistoryIndex]
        else:
            cmd = '>>> '
            self._currentHistoryIndex = len(self._history)
        
        self.replaceCommand(cmd)
1335489
def insert(self, i, tab_index):
        """"""
        _id = id(self.editor.tabs.widget(tab_index))
        self.history.insert(i, _id)
414360
def _reset_plain(self):
        ''''''
        if self._text:
            self._blocks.append(BlockText('\n'.join(self._text)))
        self._text.clear()
42690
def replace(pretty, old_str, new_str):
    
    out_str = ''
    line_number = 1
    changes = 0
    for line in pretty.splitlines(keepends=True):
        new_line = line.replace(old_str, new_str)
        if line.find(old_str) != -1:
            logging.debug('%s', line_number)
            logging.debug('< %s', line)
            logging.debug('> %s', new_line)
            changes += 1
        out_str += new_line
        line_number += 1

    logging.info('Total changes(%s): %s', old_str, changes)
    return out_str
840446
protected void insertAfterEntry(T e, T insertPos) {
        T oldNext = insertPos.getNext();
        e.setNext(oldNext);
        e.setPrev(insertPos);
        insertPos.setNext(e);
        if (oldNext != null) {
            oldNext.setPrev(e);
        } else {
            last = e;
        }
        size++;
    }
1212452
def replace(index, middleware, *args, &block)
      if index.is_a?(Integer)
        delete(index)
        insert(index, middleware, *args, &block)
      else
        insert_before(index, middleware, *args, &block)
        delete(index)
      end
    end
612943
def commit(self):
        

        tc = self.qteWidget.textCursor()

        # If this is the first ever call to this undo/redo element then
        # backup the current cursor position and the selected text (may be
        # none). This information will be required for the redo operation
        # to position the cursor (and selected text) where it was at the
        # very first call.
        if self.cursorPos0 is None:
            self.cursorPos0 = tc.position()
            self.selText = tc.selection().toHtml()
            self.selStart = tc.selectionStart()
            self.selEnd = tc.selectionEnd()
        else:
            tc.setPosition(self.cursorPos0, QtGui.QTextCursor.MoveAnchor)

        # Remove the originally selected text (may be none).
        tc.setPosition(self.selStart, QtGui.QTextCursor.MoveAnchor)
        tc.setPosition(self.selEnd, QtGui.QTextCursor.KeepAnchor)
        tc.removeSelectedText()

        # Move to the start of the (just deleted) text block and insert
        # the characters there.
        if len(self.selText) > 0:
            pos = self.selStart
        else:
            pos = tc.position()
        tc.setPosition(pos)

        # Backup the cursor position before the insertion operation,
        # insert the new character(s), move the cursor forward, and
        # backup the new cursor position as well.
        self.cursorPos1 = tc.position()
        tc.insertText(self.text)
        self.cursorPos2 = tc.position()

        self.qteWidget.setTextCursor(tc)
1163749
def insert_lines(self, count=None):
        
        count = count or 1
        top, bottom = self.margins or Margins(0, self.lines - 1)

        # If cursor is outside scrolling margins it -- do nothin'.
        if top <= self.cursor.y <= bottom:
            self.dirty.update(range(self.cursor.y, self.lines))
            for y in range(bottom, self.cursor.y - 1, -1):
                if y + count <= bottom and y in self.buffer:
                    self.buffer[y + count] = self.buffer[y]
                self.buffer.pop(y, None)

            self.carriage_return()
1167849
def replaceNewlines(string, newlineChar):
	""""""
	if newlineChar in string:
		segments = string.split(newlineChar)
		string = ""
		for segment in segments:
			string += segment
	return string
1130529
public function it_tracks_a_line_after_2_deletions()
    {
        $this->deleteLine(new LineNumber(5));
        $this->deleteLine(new LineNumber(5));

        $this->trackLine(new LineNumber(7))->getNumber()->shouldReturn(5);
    }
690695
def remove_last_line(self):
        """"""
        editor = self._editor
        text_cursor = editor.textCursor()
        text_cursor.movePosition(text_cursor.End, text_cursor.MoveAnchor)
        text_cursor.select(text_cursor.LineUnderCursor)
        text_cursor.removeSelectedText()
        text_cursor.deletePreviousChar()
        editor.setTextCursor(text_cursor)
90310
def newLine(self) :
		""""""
		l = CSVEntry(self)
		if self.keepInMemory :
			self.lines.append(l)
		return l
913898
@Override
    public void undo() {
        if (!getEditor().isReadOnly() && deleted != null && Character.isLetter(deleted)) {
            getEditor().move(getBeforeLine(), getBeforeColumn());
            getEditor().delete();
            getEditor().put(deleted.toString());
            getEditor().moveLeft(1);
        }
    }
266923
def overwrite_line(self, n, text):
        
        with self._moveback(n):
            self.term.stream.write(text)