def set_data(self, data):
        """Set the editor text contents."""
        Viewer.set_data(self, data)
        buffer = self.get_buffer()  # TODO: check this
        if len(buffer) > 1:
            self.store_state()
        else:
            state = State()
            state.store(self)
            self.history[0] = state
dataset/ETHPy150Open richrd/suplemon/suplemon/editor.py/Editor.set_data/original