docs: def set_writer(self, writer):
          """
          Changes the writer function to handle writing to the text edit.
  
          A writer function must have the following prototype:
  
          .. code-block:: python
  
              def write(text_edit, text, color)
  
          :param writer: write function as described above.
          """
          if self._writer != writer and self._writer:
              self._writer = None
          if writer:
              self._writer = writer