'Set cursor position'

def set_cursor_position(self, position):

    position = self.get_position(position)
    cursor = self.textCursor()
    cursor.setPosition(position)
    self.setTextCursor(cursor)
    self.ensureCursorVisible()
