docs: def close(self, clear=True):
          """
          Closes the editor, stops the backend and removes any installed
          mode/panel.
  
          This is also where we cache the cursor position.
  
          :param clear: True to clear the editor content before closing.
          """
          if self._tooltips_runner:
              self._tooltips_runner.cancel_requests()
              self._tooltips_runner = None
          self.decorations.clear()
          self.modes.clear()
          self.panels.clear()
          self.backend.stop()
          Cache().set_cursor_position(
              self.file.path, self.textCursor().position())
          super(CodeEdit, self).close()