def cursorAtSpaceEnd(block):
            cursor = QTextCursor(block)
            cursor.setPosition(block.position() + len(blockIndentation(block)))
            return cursor
def clear(self):
    for unused_ in range(len(self._items)):
      self.remove_item(self._items[0])