def _get_line_start_cursor(self):
        """ Get a cursor at the first character of the current line.
        """
        cursor = self._control.textCursor()
        start_line = cursor.blockNumber()
        if start_line == self._get_prompt_cursor().blockNumber():
            cursor.setPosition(self._prompt_pos)
        else:
            cursor.movePosition(QtGui.QTextCursor.StartOfLine)
            cursor.setPosition(cursor.position() +
                               len(self._continuation_prompt))
        return cursor
 Get a cursor at the first character of the current line.
        
angrmanagement/vendor/qtconsole/console_widget.py