Delete the rest of the line.
170873
def commit(self):
        

        # Get the text cursor for the current document and unselect
        # everything.
        tc = self.qteWidget.textCursor()
        tc.clearSelection()

        # 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()
        else:
            tc.setPosition(self.cursorPos0, QtGui.QTextCursor.MoveAnchor)

        # Insert the element and keep track of how much the cursor has
        # moved. This is trivial to determine automatically if
        # `yankText` is pure text, but if it is HTML code then it is
        # safer to rely on Qt's builtin ``position`` method.
        if self.textType:
            tc.insertText(self.yankText)
        else:
            tc.insertHtml(self.yankText)
        self.cursorPos1 = tc.position()

        # Apply the changes.
        self.qteWidget.setTextCursor(tc)
503902
public boolean removeLeadingEmptyLines()
    {
        boolean wasEmpty = false;
        Line line = this.lines;
        while (line != null && line.isEmpty)
        {
            this.removeLine(line);
            line = this.lines;
            wasEmpty = true;
        }
        return wasEmpty;
    }
1208320
def __cleanup(self):
        
# TODO: Test this.
        with self.__class__.__locker:

            while self.__read_buffer_index > 0:
                del self.__buffers[0]
                self.__read_buffer_index -= 1
867447
def delete(self):
        """"""
        self.conn.delete(self.jid)
        self.reserved = False
781667
def clear(self):
        """"""
        self._deque.clear()
        self._total_length = 0
        self._has_view = False
142795
def erase_up (self): # <ESC>[1J
        ''''''

        self.erase_start_of_line ()
        self.fill_region (self.cur_r-1, 1, 1, self.cols)
633682
def truncate(string, index):
    """"""
    if len(string) > index and index > 0:
        string = string[:index - 1] + u('…')
    return string
244633
public void removeTrailingEmptyLines()
    {
        Line line = this.lineTail;
        while (line != null && line.isEmpty)
        {
            this.removeLine(line);
            line = this.lineTail;
        }
    }
1282140
def trim(lines):
    
    trim_top = None
    trim_bottom = None
    _lines = lines[:]

    for (lineno, line) in enumerate(_lines):
        if hasattr(line, 'is_text_line') and line.is_text_line and not line.text.strip():
            trim_top = lineno
        else:
            break

    for (lineno, line) in enumerate(reversed(_lines)):
        if hasattr(line, 'is_text_line') and line.is_text_line and not line.text.strip():
            trim_bottom = lineno
        else:
            break

    if trim_top is not None:
        _lines = _lines[trim_top + 1:]

    if trim_bottom is not None:
        trim_bottom = len(_lines) - trim_bottom - 1
        _lines = _lines[:trim_bottom]

    return _lines
566079
def _delete_whitespace(self):
        """"""
        while isinstance(self._lines[-1], (self._Space, self._LineBreak,
                                           self._Indent)):
            del self._lines[-1]
1305758
public void cleanup() {
    htDictionary.clear();
    memoryEstimate.decrementTotalMemory(byteArray.getSizeInBytes());
    memoryEstimate.decrementTotalMemory(getSizeOfIntArrays());
    memoryEstimate.decrementDictionaryMemory(byteArray.size());
  }
562312
def cleanup_config_line(line)
        #remove comments, even those that happen inline
        line.gsub!(/^((".*?"|[^#"])*)#.*/) {|m| m=$1}

        #fix whitespace
        line.gsub!('=', ' = ')
        line.gsub!(/\s+/, ' ')
        line.strip
      end
1016056
def _delete_horizontal_space(text, pos):
    """"""
    while pos > 0 and text[pos - 1].isspace():
        pos -= 1
    end_pos = pos
    while end_pos < len(text) and text[end_pos].isspace():
        end_pos += 1
    return text[:pos] + text[end_pos:], pos
102850
def erase_line (self): # <ESC>[2K
        ''''''

        self.fill_region (self.cur_r, 1, self.cur_r, self.cols)
671659
def remove(self, line):
        """"""
        nb = 0
        for block in self.blocks:
            nb += block.remove(line)

        return nb
574646
def cut(self):
        
        tc = self.textCursor()
        helper = TextHelper(self)
        tc.beginEditBlock()
        no_selection = False
        sText = tc.selection().toPlainText()
        if not helper.current_line_text() and sText.count("\n") > 1:
            tc.deleteChar()
        else:
            if not self.textCursor().hasSelection():
                no_selection = True
                TextHelper(self).select_whole_line()
            super(CodeEdit, self).cut()
            if no_selection:
                tc.deleteChar()
        tc.endEditBlock()
        self.setTextCursor(tc)
926515
def do_drop(self, line):
        ""
        self.conn.delete_table(self.conn.get_table(line))